How to create socket connection over internet? - python-3.x

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?

Related

Access Windows Server EC2 instance with WMI Exporter in Prometheus

does anyone know what i'm doing wrong here? i'm trying to access my windows-server 2019 ec2 node locally so i can successful collect metrics via WMI Exporter and point this at my prometheus instance.I'm trying to access port 9182 for WMI Exporter, and can connect fine via localhost on my remote widows instance, also the IPv4 Address on the same instance.I've also tried to configure the firewall port on the windows host 9182. When I try to access via localhost this returns This site can’t be reached, if i try via public address on both i get Can’t reach this page. Ive opened port 3389 inbound and all traffic ipv4 outbound. Any help would be great. I have also tried adding RDP Ip directly to the inbound security rules, yet still have the same issue. Many Thanks
After installing windows_exporter, the installer will create an inbound rule for windows_exporter itself. However it may be not enough and cause your issue for some reasons. See this similar issue.
Try to add a new inbound rule for the Windows firewall and let any programs can access the listening port (default 9182). That works for me.

node js send html to network rather than only localhost server

I'm using node js trying to send my web-page to my network, I successfully call localhost:port in my computer using express as server, the webpage loads fine trigger my webcam which I used to streaming in the webpage, and then im working to make a simple app in my phone to directly access my server, so my questions:
1.How do I able to access my server from different devices in the same wireless-network? by calling ip + port ?192.168.1.104:9001 ? cause i've tried and it didnt work.
2.I've found https with .pem something like that, is that the answer ? is there also any other way ?
3.maybe any advice before i work to make my web-app to devices? using koa? i don't even really know what is that, but i'm happily take any advices.
EDIT: i've read How could others, on a local network, access my NodeJS app while it's running on my machine?
let's say I simply using random router, so i can't configure my router-port, my server in my pc and my phone join in the same network, trying to access the server in my phone
1.How do I able to access my server from different devices in the same wireless-network?
All you need to do is find your server's IP address in this same wireless-network, and find the Node.js application's port. Then access the following URL in other devices:
http://{server_IP}:{port}
However, there are some points need to check:
Need to check firewall and confirm the port is not blocked, server IP is not blocked by test device, and test device IP is not blocked by server.
Need to check whether there is any Proxy setting in server and test device. If there is any, disable the proxy.
A computer may have many IP addresses at the same time, you need to find the correct one in the same wireless-network. For example, If you install a virtual machine software such as VMware and run a virtual system inside, your real computer will get IP address as 192.168.*.* -- this IP address looks like an intranet IP in wireless-network, but it is not, and can never be accessed by test device.
2.I've found https with .pem something like that, is that the answer?
No, HTTPS has nothing to do with this problem. HTTPS just add security (based on HTTP layer), it does not impact any HTTP connectivity. Actually, to minify the problem, it is better to only use HTTP in your scenario.
There is only one very special case that may bring your problem by HTTPS -- the test machine is configured and will block any non-HTTPS connection for security.
3.maybe any advice before i work to make my web-app to devices? using koa?
My suggestion is: As there is an HTTP connectivity issue, the first step is trying to find the root cause of that issue. Thus, it is better to make a simplest HTTP server using native Node.js, no Koa, no Express. In this way, the complexity of server will be reduced, which makes root cause investigation easier.
After the HTTP connectivity issue is fixed, you can pick up Koa or Express or any other mature Node.js web framework to help the web-app work.
4.let's say I simply using random router, so i can't...
Do you mean your server get dynamic IP address by DHCP? As long as the IP is not blocked by test device, it does not matter.

Unable to open apache website from internet of my Raspberry Pi B+ V2

I setup Apache server on my Raspberry Pi.
In LAN it is working fine.
But when I tried to open it with my public IP it simply gets Timed Out.
I opened a Port : 2323
Checked on canyouseeme.org
Means I have configured port forwarding correctly...?
Now I am trying to open this page with url: 122.175.144.237:2323 it shows Time Out Error.
I have 2 devices
Binatone ADSL2/2+ Modem+router
Tenda N3 Wirless N150 WiFi Router
and my Raspberry Pi is connect with WIFI with static IP 192.168.192.99
I searched for this problem but till now not found any appropriate solution.
Is there any problem in configuration of Apache? or I missed some configuration. or it is because of apache restricting to open page with public IP or not allowing to open over internet.
Is there any way..?
Even if the port is open on the external interface of your router, that doesn't necessarily imply that port forwarding is setup correctly, just that the router isn't flat-out rejecting that traffic. Also, as you have a second wireless router in your network (that is probably itself running NAT), you must also have port forwarding setup on that as well.
Apache must also be configured to answer for the virtual host it is being addressed as. It should answer on it's IP with a default page, but without knowing specifics I couldn't rule it out.
That should get you started, but at this point you still need to narrow the problem down quite a bit before proceeding.

Amazon Nodejs webserver

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.

No connection could be made because the target machine actively refused it firewall issue

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.

Resources