# README
vncproxy
It provides a HTTP Handler to implement the VNC proxy over websocket.
you can use it easily as following:
tokens := map[string]string {
"token1": "host1:port1",
"token2": "host2:port2",
// ...
}
wsconf := vncproxy.ProxyConfig{
GetBackend: func(r *http.Request) string {
if vs := r.URL.Query()["token"]; len(vs) > 0 {
return tokens[vs[0]]
}
return ""
},
CheckOrigin: func(r *http.Request) bool {
return true
},
}
handler := vncproxy.NewWebsocketVncProxyHandler(wsconf)
http.Handle("/websockify", handler)
http.ListenAndServe(":5900", nil)
Then, you can use noVNC by the url http://127.0.0.1:5900/websockify?token=token1
to connect to "host1:port1" over websocket.
NOTICE: The sub-package cmd implements the function above, but using the redis to store the mapping between TOKEN
and HOST:PORT
.
# Packages
No description provided by the author
# Functions
NewWebsocketVncProxyHandler returns a new WebsocketVncProxyHandler.
# Structs
ProxyConfig is used to configure WsVncProxyHandler.
WebsocketVncProxyHandler is a VNC proxy handler based on websocket.