An attempt was made to access a socket in a way forbidden by its access permissions on port 80 - sockets

I have my own web site hosted on a dedicated server. I have 2 IP addresses set up.
One is for my web server and the other is for my web socket.
I did this so that my web socket clients can access my server using port 80.
However, when I run my server application I get the error:
An attempt was made to access a socket in a way forbidden by its access permissions
Now if I switch it to a different port it works (which I have allowed through the firewall). There is nothing entered in the Windows Logs.
I am running as an Administrator. I am using Windows server 2012.
Is there anything I can check?
I checked using netstat etc but this IP address is not being used on port 80 anywhere else
I have 2 IP addresses pointing to my server hosted at FastHosts.
So I have a web site (using IIS)
Originally I had a web socket connection/listener listing on port 8090.
I had created a rule in my firewall settings to allow access to this connection.
Indeed for over a year now I have been using this connection using port 8090.
It occurred to me last week that using a clients PC that they could not access the socket over port 8090. I assumed because of firewall issues.
So, I figured if i switched to port 80 for this socket it will not need an exception to that clients firewall rules.
The trouble is I cannot have a web server listening on port 80 and a web socket so I purchased another IP address from my host and 'added' to my network adapter.
I have made sure nothing else is using port 80 for this new IP address. But I get the access denied
As a test I created a default.html page which said 'hi' all with no issues. I then 'stopped' the web server for that IP address

Related

How to set up a client/server connection using port forwarding

I created a multi-threaded client/server application that can send messages to each other at real time. Everything works perfectly, but I want to be able to send messages over the Internet. From what I understand, I need to do port forwarding to be able to make my server reachable for the clients. I then set up my port forwarding options by providing a port (9991) and then my Macbook Air's IP Address (192.168.0.1).
I then tried to connect to my server using my public server IP (let's say 197.132.20.222) and it didn't work. I then tried to see if the port forwarding worked by using this website: https://www.yougetsignal.com/tools/open-ports/ and I realized that the connection was closed. I also tried the command nc -vz 197.132.20.222 9991 while running my application and the connection is refused.
I'm using a JavaFX application, and for my server side I use a ServerSocket with port 9991. For the client side, I use a Socket and set the IP Address to my public router IP Address, and I tried to connect with another PC using mobile data to use a different network.
My firewall settings are turn off, so I really don't know what is blocking my application to connect to that port. Could it be my ISP is blocking connections? I just don't understand why my ports are blocked even with no firewalls enabled.

Is it possible to run web server on private IP?

I'm trying to implement a web server on my pc, connected to router.
Since my PC is connected to router, It identifies private IP address, starting with
192.168...
However,it could not accept any clients that is not connected to the same router, even I specified tried with public IP address.
Is it possible to implement Web server that can be accept clients from anywhere with my PC connected to local router?
Or should I connect my web server directly to public IP directly without router?
It'll be pleasure to learn from your answers.
The problem may be, that your web server routing may not be configured correctly to your external IP, or your web server ports may be blocked, or another possibility is that your firewall is blocking your service connections outside the local network.
So, a solution to misconfiguration would be, to forward your port to your internal IP of the web server from your router menu.
And, for the case of firewall blocking, you may give special access to your web server through the firewall by setting inbound and outbound rules.
And if all that is correct then most probably your ISP(Internet Service Provider) is not allowing ports to be opened to you, maybe due to dynamic IP or service restrictions.
For the similar problem, you may refer to my answer to another post Here
What router do you have? go into the router using a web browser, mine is 192.168.0.1 with username and password as admin. or username admin, password blank.
Then set a dmz route or for port forwarding 80 to you own internal IP address.

unable to connect to openfire server with external ip

I'm trying to connect to openfire server using spark. I have dynamic dns, made port forwarding on port 5222 in d-link router. When i'm logging with host name as private ip for example "192.168.0.101" - connection is established, but when i'm setting my domain (pizokas.hopto.org) as host name i get the following error
Unknown connection error. Please review logs for the following information.
But there are no logs in openfire server, so i assume packets are dropped in router. I have firewall turned off. At this point i can't find information why the connection cannot be established. I'm using my own laptop as server and as a client, os win 10. Maybe somebody had similar issue?
The connection was established when i was trying to connect to server from outside of lan

Can't connect to my webserver from external source

I am having problems connecting to my website from a source outside my local network. I had another server before running the same site. The only difference is the old one was FreeBSD and now I'm trying it on Linux.
Here is my setup: I'm using Apache2. The server is behind a Netgear router. I'm using a Freedns host name. I have ddclient updating my ip.
Here is what happens: I can look at my site from the server in Chrome or my phone connected to the local wifi. It works using either the host name or ip address. It does not load from my cell phone or from my desktop using a proxy for either the host name or the ip address (the external one from googling my ip and from the router's wan info page). When I try the proxy with the host name I get "conection timed out" error, and when I try the ip address I get "couldn't connect to host error".
Here is what I've tried: I enabled port forwarding to the server from and to port 80 to my lan ip address. I disabled the firewall on the server. I double checked that the host name is directed to the right ip address. I ensured that the ip address does indeed point to my router. I've watched wireshark on my server while trying to connect and don't see any incoming requests when I try to load it from my phone.
It seems like maybe my port forwarding isn't working, but on my router it says that that port forwarding rule is active.
I'm out of ideas as to why what else could be going wrong.

Connecting to Local Web Server when I am Outside my LAN

I have a web server running out of my home. I have assigned it an address such as 192.168.1.123 on port 80.
I understand that this is running on my local network. If I go to another computer on my network and type in the server's ip address, I can see the server.
Is there a way to access this server from outside my LAN?
Yes, you need to set your router to forward connections to port 80 to your internal IP address (192.168.1.123). Look for Port Forwarding on your router admin screen which I would imagine you access by going to http://192.168.1.1
Keep in mind that your ISP may block port 80 completely in which case you can run your web server on a different port (for example por 8180) and have your router forward connections to port 8180 to your internal IP.
To access your server from outside, you just need to point your browser to your external IP address which you can find out by going to http://www.ipchicken.com
Assuming you have a connection to the internet:
https://github.com/progrium/localtunnel
is a quick way to access your local server from the internet. There might be similar implementations in other languages/platforms. This is just the one I know about.
Remember that security issues need to be carefully considered when opening your local network to the world.
If you use a PHP Webserver you can set it this way:
php -S <YourIPAdresse>:<SomePortNumber> <StartPHPpage>
Example: „php -S 192.168.1.123:9000 index.php"