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

Add SSL support to WebSocket server #126

Closed
sajinshrestha opened this issue Sep 15, 2016 · 3 comments
Closed

Add SSL support to WebSocket server #126

sajinshrestha opened this issue Sep 15, 2016 · 3 comments

Comments

@sajinshrestha
Copy link

I'm trying to use LiveReactload over https but can't get it to work. Console shows the server is up and listening correctly.

[21:25:10.091] LiveReactload :: Reload server up and listening in port 4474...

browser console error:

LiveReactload :: LiveReactLoad transform detected. Ready to rock!
card.js:37 WebSocket connection to 'wss://example.com:4474/' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED

npm script:

watchify index.jsx -t babelify -p [ livereactload --host='example.com' ] -o static/bundle.js

Any ideas on how I can troubleshoot this?

@sajinshrestha
Copy link
Author

I'm guessing I need to pass tls certificates to ws server, but not sure.

@milankinen
Copy link
Owner

Hmmm. The current implementation doesn't support certificates ATM but I think it wouldn't be so hard to implement by following e.g. this tutorial: http://www.chovy.com/web-development/self-signed-certs-with-secure-websockets-in-node-js

I have unfortunately so little time for open source at the moment so PR's are more than welcome! 😄

Perhaps CLI options --ssl-cert <certFilename> and --ssl-key <privateKeyFilename> could do the job?

  • If both of them are given, then the backend could use HTTPS
  • If only either of them is defined, then error/warning is displayed
  • If neither of them is defined, then use the current implementation

@milankinen milankinen changed the title WebSocket connection failed Add SSL support to WebSocket server Sep 16, 2016
@sajinshrestha
Copy link
Author

Thanks, @milankinen. I'll give it a try.

@fozzle fozzle mentioned this issue Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants