amitbet / vncproxy

An RFB proxy, written in go that can save and replay FBS files
Other
206 stars 45 forks source link

Support for Serving on Generic net.Listener #34

Open adrianosela opened 4 months ago

adrianosela commented 4 months ago

Support for Serving on Generic net.Listener

Adds the ability to initialize a VncProxy object with your own net.Listener.

Example:

Where ln is a net.Listener implementation

    proxy := &vncproxy.VncProxy{
        NetListener: ln,
        ProxyVncPassword: "server-password",
        SingleSession: &vncproxy.VncSession{
            TargetHostname: "127.0.0.1",
            TargetPort:     "5900",
            TargetPassword: "target-password"
            ID:             "dummySession",
            Status:         vncproxy.SessionStatusInit,
            Type:           vncproxy.SessionTypeProxyPass,
        },
        UsingSessions: false,
    }

This is useful to me because I have a listener that does end to end encryption and other additional functionality. It's basically a TCP connection with LOTS of middlewares - abstracted as a net.Listener. I would love for the vnc proxy to accept connections over this net.Listener.

adrianosela commented 4 months ago

@amitbet it would mean a lot to me for this change to be reviewed :) thanks for the awesome work.