websockify
websockify copied to clipboard
websockify issue multiple user control one vnc server
i am doing research on websockify but i am facing a problem i want multiple users to access my vnc independently but when i use the command
websockify -D \
--web /usr/share/novnc/ \
--cert /etc/ssl/novnc.pem\
6081 \
localhost:5901 \
2>/dev/null
And accessing novnc from 2 different browsers to control vnc, it's like the same machine controlling 1 screen, is there any help when I access novnc from different machines they work independently?
After 2 days of researching, I think I can use token to do this but I don't know how to use websockify token can you help me
Have you checked the wiki page about using tokens?
It's found here:
https://github.com/novnc/websockify/wiki/Token-based-target-selection
Have you checked the wiki page about using tokens?
It's found here:
https://github.com/novnc/websockify/wiki/Token-based-target-selection
yes i have read it but i don't seem to fully understand this is the token file i created and this is the command i use
websockify -D \
--verbose \
--web /usr/share/novnc/ \
--token-plugin=TokenFile \
--token-source=/etc/websockify-token.cfg \
6080
import memcache
import simplejson
class TokenMemc(object):
def __init__(self, src):
self._server = src
def lookup(self, U6F7msdQ):
client = memcache.Client([self._server], debug=0)
stuff = client.get(U6F7msdQ)
combo = simplejson.loads(stuff)
pair = combo["34.82.215.8:5900"]
return pair.split(':')
I used this url http://34.82.215.8:6080/vnc.html?resize=remote&path=novnc/websockify?token=U6F7msdQ
this is the error i got

I'm afraid you're mixing up sections. Please only look under the TokenFile Plugin heading and the example there. The Custom Plugins heading is for advanced usage where you write your own code. This assumes a familiarity with programming and is not for most users.
I'm afraid you're mixing up sections. Please only look under the TokenFile Plugin heading and the example there. The Custom Plugins heading is for advanced usage where you write your own code. This assumes a familiarity with programming and is not for most users.
but i don't have target.config.d file
That is something you'll have to create. websockify is not preconfigured for any tokens.
That is something you'll have to create. websockify is not preconfigured for any tokens.
how do i make it can you be more specific
That is something you'll have to create. websockify is not preconfigured for any tokens.
is my targt.config.d correct?
// my targt.config.d U6F7msdQ: 127.0.0.1:5900 1oJw2DwG: 127.0.0.1:5901
Yes, that looks correct. Normally target.config.d will be a directory with multiple files, but it's also okay to just point directly towards a single file.