I'm getting the error dial tcp [::1]8080: connect: connection refused when I run ngrok and yes I tried other ports and I get the same thing.
I'm not sure why just cause I never had this problem before with ngrok and I used ngrok for years.
I know ngrok isn't listening on any port I put in which is why I am getting this error message. The program just stopped working for whatever reason on anything. I want to fix this and know why after a long time having no issue with the program this happened.
Not sure how your code looks like but make sure the port is exposed. If it's exposed it should be working properly and giving you the redirect.
If you added/changed any firewall to your server for example in AWS make sure it's accepting the proper inbound IP address/ making it public.
Related
I'm trying to set up a Mastodon instance on my Raspberry Pi 4 at home, running Raspbian/Debian Linux. I have no idea what I'm doing.
The nginx server is running, working. When I access it from localhost or from inside the LAN, it gives a result like this, as expected:
When I try to access it from outside the LAN, it eventually times out or gives a "connection was reset" error.
Or in firefox:
At first I suspected that it was a problem with my firewall, like maybe it was blocking HTTP traffic into it. But it's allowing HTTP traffic through. I even stopped the firewall entirely, but it's still doing the same thing. (I'm using IPTables)
All of the necessary ports should be forwarded to the pi on my optimum router:
Here's the site's nginx config, just an edited copy of mastodon's given nginx configuration template. I have the HTTPS server commented out, as I'm only working with HTTP right now. I'm trying to get the http server working so I can use certbot to get an SSL certificate, but certbot's unable to connect to the nginx server, runs into the same "connection reset" error. The server_name is irrelevant (or is it?) as i'm just trying to connect to it through IP right now, and commented out the other "location" properties that the template came with, as I'm just trying to get the server to work in the first place, running mastodon on it and getting the SSL certificate and getting the domain to work will come after.
What causes it to work inside LAN but not outside it? Even with the necessary ports forwarded to the pi?
Edit:
Here's what it looks like inside the LAN, working correctly:
and here's when I try to access it outside the LAN (through ProtonVPN in this case)
https://www.reddit.com/r/OPTIMUM/comments/rxjw1v/optimum_internet_not_forwarding_traffic_on_port_80/
By default, Optimum blocks ports 80 and 25, even if they are port-forwarded.
Optimum support referred me to this obscure page that I couldn't find linked anywhere on the site, did exactly what i needed: https://www.optimum.net/internet/boost/
I'm following the Node.js Getting Started section of the Heroku docs, and when I true to run heroku login, it displays:
Post https://api.heroku.com/login: http: error connecting to proxy https://proxy.server.com:3000: dial tcp: lookup proxy.server.com: getaddrinfow: No such host is known.
The docs tell me to run set HTTPS_PROXY=https://proxy.server.com:portnumber in order to fix this if I have a firewall that requires a proxy to connect with external HTTP/HTTPS services (which I'm assuming I do)
I'm not sure which portnumber to use when I run this command.
When I try 3000 it gives:
ECONNRESET: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND proxy.server.com proxy.server.com:3000
So I'm not exactly sure why I can't login, and also why that particular error pops up when I run the given command set HTTPS_PROXY=https://proxy.server.com:portnumber to resolve it (nor do I actually know what the given command does)
You likely do not need to set this unless you are absolutely sure you are behind a firewall that specifically blocks the IP api.heroku.com resolves to. The https://proxy.server.com:portnumber is just an example and could be something completely different.
Since you don't seem to understand what this does, you likely do not need to set this. Are you able to connect when you are not setting the proxy?
I'm getting stuck here, so i have an amazon ec2 (standard redhat server) host up and working. i can connect to it personally no problem, however it cannot be connected to outside of my ip.
I've checked the rules and i have port 80 and 3000 open to 0.0.0.0/0 to be able to communicate, however outside of my computer (and computers in this network) i can not connect.
Everything I've found is about connecting to ssh which works fine, i have no rules in iptables, i haven't dealt much with them before, but since i can connect to the service i don't think its the issue.
summary:
Web server is running, i can connect from my computer to it, and any others in my local network, but nothing outside of it works.
i do have httpd installed as well as a simple forward from the browser to port 3000, however i cant connect to it either from outside my network.
so this is a new one for me, the dns forwarding works in houst, but not outside. so inside and outside here, i can use IP address to connect, but inside only i can connect with my dns lookup. not sure what caused this, but its not an amazon problem at least. going to look at that side.
I've installed ghost as per the instructions on the official documentation: http://support.ghost.org/installing-ghost-linux/
When I run ghost in development or prod mode, I get this output:
Ghost is running in development...
Listening on 127.0.0.1:2368
Url configured as: http://localhost:2368
Which is exactly what I expect. Now my remote server has an ip of something, lets say 123.456.68.1. I should be able to hit the running ghost server by going to http://123.456.68.1:2368 right? Well when I try doing that I get this error:
Failed to load resource: net::ERR_CONNECTION_REFUSED
What am I doing wrong? Please help!
NOTE
If I run a node server on port 80 I can hit it by going to 123.456.68.1. For somereason I cant hit the ghost server.
Without some more details on where your server is ect this is a bit hard to answer.
First check to ensure that your server socket is bound to the correct interface. The fact that it is saying it is on 127.0.0.1 may mean that it is bound to the loopback interface and this means that you can't connect to it from another machine. Run the following to check:sudo netstat -ntlp. If this shows your process bound to 127.0.0.1 then this is likely the problem. You can fix it by passing 0.0.0.0 in the listen call: connect().use(connect.static('public')).listen(3000, "0.0.0.0");
If that isn't the problem then it is likely that you network setup is the problem. There are many places here it could be. Firewalls, routers, port forwarding configurations ect. If the above doesn't work then we will need to know a little bit more about your setup to help further.
I disable the internet connection and run the node server npm start, then it throws the error:
And now enabling internet connection and running the server works fine:
So, I want to confirm if this really needs to be connected to the internet while starting the server?
If it really needs internet connection, then is there any idea to run the server offline?
If I connect to the internet and run the server and there after plug out the internet connection then there's nothing goes wrong. Everything works fine. I don't know why just running the server requires the internet connection.
OMG! It's really cool! I got it working offline after hard research in my code using 127.0.0.1 instead of localhost for mongo uri.
Using localhost needed for me to connect to the internet.
And using 127.0.0.1 worked in both condition i.e. with internet connection and without internet connection.
But, really I'm totally amazed of this.
I found the really cool topic on this which made me clear about this.
If you use 127.0.0.1, then (intelligent) software will just turn that directly into an IP address and use it.
And there's no guarantee that your hosts file will actually be used for that resolution (first, or at all) so localhost may become a totally different IP address.