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

Express IP binding issue? #3

Open
lazydino opened this issue Oct 12, 2018 · 3 comments
Open

Express IP binding issue? #3

lazydino opened this issue Oct 12, 2018 · 3 comments

Comments

@lazydino
Copy link
Contributor

Hi Nikolay,

There is a IP binding situation I could not figure out. The express server seems unable to serve from IP other than localhost? I am fine with http://localhost:3007, but was refuse of connections with url like "http://[myip]:3007" ? Chrome will even go and rewrite the URL as "https:[myip]:3007"? The older branch of lcs-v0.1 , which doesn't use express js, does not seem to have the problem.

I go and change index.js:84 to force it bind my IP like

var srv = ssl ? https.createServer( sslOptions, app ).listen( port, '192.168.1.84' ) : http.createServer( app ).listen( port, '192.168.1.84' );

It still does not work?

@lazydino
Copy link
Contributor Author

Further investigation leads me to routing in index.html. Seems to have something to do with micro client side routing of page.js ? Is it possible to run livecodingspace on a LAN environment and have LAN nodes run browser for test?

@NikolaySuslov
Copy link
Owner

Hello Reggie,

Thanks for pointing to that, I have needed to write about this in documentation.
It is caused by Gun DB (SEA) only, which heavily uses WebCrypto, that does not work without HTTPS. So, if URL is not localhost, it redirects to HTTPS.
The best way to use on LAN is to generate self-signed certificate and run a server with it:
node index.js -p 3007 -s -k ./certs/server-key.pem -c ./certs/server-crt.pem -t ./certs/ca-crt.pem -w cert_password

Best regards,
Nikolay

@lazydino
Copy link
Contributor Author

lazydino commented Oct 15, 2018

Hi Nikolay,

Do I need to run Gun DB storage in https? What about reflector? I am able to run some tests under all 3 server instances on HTTP localhost. So this won't actually work for Gun DB SEA and WebCrypto? If I have the main website tested in secured localhost, aren't the other two needs to be also in HTTPS to prevent browser complaining of 'mixed content'?

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

2 participants