skywire icon indicating copy to clipboard operation
skywire copied to clipboard

Serve visor rpc interface over dmsg using `dmsgpty_whitelist` for auth

Open 0pcom opened this issue 7 months ago • 0 comments

Currently, it should be possible to proxy the visor's local rpc interface port over dmsg and back to a local port on another machine using skywire dmsg web & skywire dmsg web srv

With a small change, it will be possible to do this with one instance of skywire dmsg web

The visor basically serves it's rpc interface to the hypervisor over dmsg, after connecting to the hypervisor, currently.

As an alternative to many clients basically reaching out to a server, we should allow incoming connections to the interface over dmsg using the dmsgpty whitelist in the visor's config to determine which keys may connect.

Then it should be possible to use skywire dmsg web to proxy multiple dmsg addresses : to ports on localhost using one dmsg client. Hence the setup is simplified as you only need to whitelist the same one public key in order to put the remote visor's rpc interface onto a sequential series of adjacent ports to localhost:3435 - the default rpc interface for skywire cli.

Then skywire cli may be used to control different visors by setting the --rpc flag to the port corresponding to the given visor. Essentially only one service need be configured. And the configuration is fairly straightforward, just whitelist one key on all your visor's configs, and then set the correct dmsg address of the remote visor's rpc interface which is being served over dmsg, and the corresponding port to proxy to on localhost.

It may also be possible to permit skywire cli to work through a proxy, and to take advantage of the dmsg address resolution of skywire dmsg web - though I've never tried this with TCP directly. Then I suppose one would specify --proxy flag and then for the rpc interface, put the actual dmsg address of the remote visor's rpc interface over dmsg. :3435. We should get the port for this from the port of the rpc interface which has already been specified in the config with default localhost:3435

0pcom avatar May 13 '25 15:05 0pcom