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

Make web sockets work behind port forwarding #42

Closed
mlopezr opened this issue Oct 5, 2016 · 5 comments
Closed

Make web sockets work behind port forwarding #42

mlopezr opened this issue Oct 5, 2016 · 5 comments

Comments

@mlopezr
Copy link

mlopezr commented Oct 5, 2016

I'm trying to set up cryptpad (listening at http and websocket on port 3000) behind a nginx reverse proxy that forwards requests sent to e.g. mycryptpad.example.com:80 to 192.168.0.1:3000

It works for static web content.

However, when the web client performs a GET on /api/config, it is told to open a websocket to ws://mycryptpad.example.com:3000, but it should be 80
The relevant code is at server.js line 55

This is hard to rewrite in reverse proxy configuration.

Could you add in config.js an optional parameter with the port to be shown to web clients in case it's different to the listening port?

Thanks so much for your work!

@ansuz
Copy link
Contributor

ansuz commented Oct 5, 2016

Hi, we've been migrating from apache to nginx on our production machine. We've had the same issue, and it is now patched in the soon branch. We have a little more testing to do, and then it will be merged to master.

@mlopezr
Copy link
Author

mlopezr commented Oct 5, 2016

I had a look at the soon branch and it looks like it will solve the problem. Thank you!

@Moredread
Copy link

But what was the issue!

@ansuz
Copy link
Contributor

ansuz commented Apr 8, 2017

The server used to try to infer the URI for the websocket. Now you explicitly set the value in your config.js file.

@Moredread
Copy link

Thanks :)

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

No branches or pull requests

3 participants