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

Default host IP value incompatible with Heroku #154

Closed
JedWatson opened this issue Feb 3, 2014 · 3 comments
Closed

Default host IP value incompatible with Heroku #154

JedWatson opened this issue Feb 3, 2014 · 3 comments
Labels

Comments

@JedWatson
Copy link
Member

As noted by @bladey on issue #148, assigning a default IP of '127.0.0.1' (localhost) doesn't work on PAAS services like Heroku out of the box.

Explicitly assigning an IP Address of '0.0.0.0' to express does seem to work correctly (thanks @TheBenji), so it makes sense to instead use that as the Keystone default.

Since I'd prefer to have Keystone work on Heroku without any more config than absolutely required, I'm going to implement that.

If anyone knows of any issues it may create, please let me know!

@azproduction
Copy link

Unix socket is also possible, if Node is behind nginx or lighttpd.

Don't you think that mongdb-style "Connection String URI" is better format then port+host || socket?

http://unix:/var/run/my/index.sock - nginx proxy_pass format
http://0.0.0.0:3000/
https://0.0.0.0:3000/?key=test/fixtures/keys/agent2-key.pem&cert=test/fixtures/keys/agent2-cert.pem

And default will be http://0.0.0.0:3000/

@TheBenji
Copy link
Contributor

TheBenji commented Feb 3, 2014

Actually thanks to the great support-team from https://modulus.io/
(had the same problem on their platform and they helped me out)

@JedWatson
Copy link
Member Author

Good points @azproduction, thanks.

I've made some major changes to the way keystone is initialised, supporting using the options

  • port (the old / simple method, use option port or env.PORT)
  • port and host (for when you also want to specify an IP address to listen on, use option host, env.IP or env.HOST)
  • listen (for anything else that's supported by the http.listen method, use option listen or env.LISTEN)

ref http://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback for docs on http.listen.

I haven't been able to successfully test the "Connection String URI" option (which should work if you set the listen option and no others), I don't have an nginx setup handy, so if someone could confirm it works as expected that'd be great.

The Port and Host options work properly, and it now lets you know if it's using the default port 3000 or a specifically assigned one in the console log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants