Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support websockify behind a proxy #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

developerdong
Copy link

If the whole nodejs server is behind a proxy like nginx, this change makes the websockify work well. For example, a request is sent to http://exmaple.com/myvnc, nginx rewrites the path from /myvnc to /, then proxy-passes the request to localhost:6900. Previously, vnc/index.html wrongly tries to connect ws://example.com/websockify, which is forbidden by the nginx. After setting PRE_PATH to /myvnc/, the URL is ws://example.com/myvnc/websockify, then can be processed by nginx. If the whole nodejs server is not behind a proxy, without setting PRE_PATH, the index.js behaves like before.

If the whole nodejs server is behind a proxy like nginx, this change
makes the websockify work well. For example, a request is sent to
`http://exmaple.com/myvnc`, nginx rewrites the path from `/myvnc` to
`/`, then proxy-passes the request to localhost:6900. Previously,
`vnc/index.html` wrongly tries to connect `ws://example.com/websockify`,
which is forbidden by the nginx. After setting `PRE_PATH` to `/myvnc/`,
the URL is `ws://example.com/myvnc/websockify`, then can be processed by
nginx. If the whole nodejs server is not behind a proxy, without setting
`PRE_PATH`, the `index.js` behaves like before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant