Node js server with websockify

2.3k views Asked by At

I need to connect websockets with normal sockets, websockify looks seem the answer, but I don´t really understand what do I need to do whit this info: https://www.npmjs.com/package/node-websockify, do I need to create a Node js server, or only run into my page??

1

There are 1 answers

0
romeski On

The websockify people were nice enough to create a node js version located here -

  1. enter the command node websockify.js [--web web_dir] [--cert cert.pem [--key key.pem]] [source_addr:]source_port target_addr:target_port

so the command:

node websockify.js --web web 127.0.0.1:9988 192.168.1.40:5432

would start a "relay" from the target address (the server you don't have access to) to your own proxy server (server you do have access to - where you are proxying the websockets from the vnc server to TCP, which enables you to view the connection via web browser. With this proxy comes a built-in web server to "serve" the view. so the web option is the location of said HTML, CSS, and JS files to display. If you copy the files from the app directory css-files and the vnc file from the root with all dependencies, you can then view the files by navigating to the source IP address and port and that should take care of it.