So, I'm having an issue where I'm using a public IP in my io.connect. The problem is that it does not connect.
I'm 100% sure that the ports are opened and that the firewall is not blocking the ports.
The code is:
// Try connection
try {
var socket = io.connect('http://94.211.125.196:8080');
} catch(e) {
// Set status to warn user
}
I did not get any errors. It should only show some messages inside my chat program which it isn't because of the connection not working.
If I use a local IP it does work.
UPDATE
I have asked a question about Node.js and public IP's before, which is different than this question because I was talking about the /socket.io/socket.io.js in that question. This question is about the io.connect.
Fixed the issue.
I check everything, I made sure that I port forwarded everything to correct way to the server and also made sure that the server wasn't blocking the port.
Apparently, my second router has all ports forwarded except this one. This caused the issue which is now fixed.
Thanks to everyone who helped!
Related
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.
I have created a server-side and client-side console based Chatroom. I have done the port forwarding and also added the inbound rule to the firewall settings both in client-side and server-side. It is working fine with computers on the same network but when I connect to the server/socket with different network(mobile hotspot) it doesn't work. I know my public ip address and I have it tried using it also. I am using TCP connection and a port-'55555'. I have windows 10 os on my laptop. Also tried after disabling the virus protection, it didn't work.
Can you please suggest some ideas regarding how to make it work?
I try to enable into my desktop the remote access option to this desktop.
Everything setted ok but when I try to login using the remote access from another place it doesn't work.
The computer is open.
I made a ping to my desktop address and I receive this
Request timed out.
Request timed out.
Request timed out.
Request timed out.
so it seems it is not recacble to public
Any help how can I fix it?
You will have to change settings on your router to forward the request to "this" desktop. And the request, from remote, should be made to the public IP of your router that your ISP assigned to you.
This might not solve your problem, but it does answer the (title of) your question: try ngrok
I am doing socket-client programming in C#.
I have written TCPListener on Socket server side.
It works fine when I try to connect to it from client side on same machine. But if Socket server and client both are on different machine, I get exception saying "No connection could be made because the target machine actively refused it".
I checked socket information like ip address and port number on both the side which are absolutely correct.
I checked Antivirus log, it clearly stated that Antivirus/Firewall blocking the ip traffic.
I can't change Antivirus/Firewall settings as these are disabled by an Administrator.
Is there any programmatic way to tackle this problem? Is there any option while writing TCPLister or socket client which can provide me solution to tackle issue of Firewall.
Any help that can be provided would be greatly appreciated. Thank you.
I don't see how this could be done. If the firewall blocks the traffic, the firewall needs to be configured accordingly so traffic is allowed. There's no other way.
I want to connect from client side to two different node servers that are actually running on the same local ip address but on different ports. The problem is that the first io.connect() succeeds but the second one fails. I've read that in order to get it working, the second io.connect call should include the force new connection property set to true. I tried it but without much success... Here you are a pretty simplified version of my code:
dataSocket = io.connect('https://' + window.document.location.host);
...
socketOut = io.connect(data.url, {'force new connection': true});
Basically, the first connect opens a socket on https://192.168.1.129 (port 443) and the second one on https://192.168.1.129:3000 and it is this last one which fails. Both servers are running and accepting connections during these calls (obviously). The curious thing is that if I replace the private local address with localhost, it works. I'm definetely missing something...
Any suggestions?
It was a certificate issue (using a self-signed certificate for the CA). By just connecting to https://192.168.1.129:3000 one time via web browser and accepting the risk alert, everything works.