sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.63k stars 732 forks source link

Connection Refused to Web Server #345

Closed joemccann closed 6 years ago

joemccann commented 6 years ago

First, this is an awesome project and I'm happy to be using it! 🙏

I was able to get pgwebto run with no problem on my Mac, but when I create a brand new EC2 instance with ALL TRAFFIC open to it, I get a connection refused error.

On the machine itself, I can curl localhost:8081 and it sends back the HTML to the login screen.

This is the command:

./pgweb --host=XXX-rds.XXX.us-east-1.rds.amazonaws.com --port=5432 --user=ubuntu --db=dividend_alerter_db --pass=XXX

The odd thing is I have another Express App running on Port 8666 and it connects with no problem. If I create a dead simple go server it also works fine so I'm vexed as I'm not sure why pgweb is blocking outside connections when I have ALL TRAFFIC enabled in the security policy and other http servers and serving fine.

Thanks for any help in advance!

sosedoff commented 6 years ago

@joemccann thats because by default pgweb is listening on localhost only. you can bind the server to any network interface with --bind=0.0.0.0 flag.

joemccann commented 6 years ago

ahhhh sorry I didn't see that in the docs!

joemccann commented 6 years ago

yup that fixed it. Thanks!