pojntfx / go-nbd

Pure Go NBD server and client library.
Apache License 2.0
346 stars 18 forks source link

Support NBD URIs in the client #10

Closed rwmjones closed 2 months ago

rwmjones commented 6 months ago

Just want to make you aware of the NBD URI specification. It's a simple extension of the basic NBD protocol, allowing an easy and cross-client way for NBD endpoints to be specified. eg:

nbd://localhost = NBD unencrypted over TCP to localhost:10809, default export name

nbds+unix:///default?socket=/tmp/sock = NBD encrypted over Unix domain socket /tmp/sock, export name default

Some other examples below, as well as more in the specification above. https://libguestfs.org/nbd_connect_uri.3.html

rwmjones commented 6 months ago

(Adding @ebblake)

pojntfx commented 2 months ago

This could be interesting, but it's not something that really is in the scope of this project since it's intended for the for use as a library. The internal interface asks for any net.Conn, so this is something that could be implemented by anyone using the go-nbd library:

func client.Connect(conn net.Conn, device *os.File, options *client.Options) error