C# client can't connect to server with port 8080 - c#

Why my client can't connect to the server with port 8080. I use vpn to set network lan But port 80 is working fine.
When I connect to site by ip in port 8080. it's return This site can’t be reached The connection was reset.
How can i fix it.
my server is iis7.

Related

No connection to tcp port

I'm trying to set up a server that connects to a tcp port, but when I activate the cloudflare proxy, it's not connecting to the port, what could it be?
Test login only with ip and i was successful, also only with domain and i was successful

Client program can't connect to server hosted on 0.0.0.0

I made a client program and a server program
Hosting and connecting to 127.0.0.1:23000 works:
hosting and connecting to 127.0.0.1
but hosting and connecting to 0.0.0.0:23000 doesn't:
hosting and connecting to 0.0.0.0
If I host a server on 0.0.0.0:23000 and connect to it using telnet, it works. But not if I use my client, why?
Here's me connecting to my server which was hosted on 0.0.0.0:23000 with telnet: telnet connecting to 0.0.0.0
I made it so that if localhost is the input IP, the IPAddress object is assigned IPAddress.Any, why does it not work?
Here's the exception in text:
System.Net.Sockets.SocketException (0x80004005): The requested address is not valid in its context 0.0.0.0:23000
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
at SocketClient.Program.Main(String[] args)
As I was writing this I've realized why it works with telnet but not with my client: Apparently, when a server is hosted on 0.0.0.0 a client can't connect to 0.0.0.0 but it can connect to the server through 127.0.0.1, so to connect to the server which was hosted on 0.0.0.0 you would need to connect to 127.0.0.1 because that's the loopback IP.
This is what telnet does, when you type in "localhost" as the IP, it connects to 127.0.0.1, not 0.0.0.0. This can be seen when the telnet client connects and it's IP endpoint is shown on the server.
Here's me getting my client to connect to my server which was hosted on 0.0.0.0: connecting to server hosted on 0.0.0.0

Azure VPS as TCP server

I'm using an Azure VPS to host a TCP server (raw sockets) but the external client is timing out when it tries to connect to the server. I've already opened the TCP ports on Azure Portal.
It works locally so it can't be a problem on the code.
(Note that the address shown in the server print is just the local address, the client is pointing to the server external address)
Server running:
Client timeout:
Well it turns out the problem was the VM firewall. Just added the inbound rule and it worked!

"Server cannot accept argument" exception thrown by FTP server in IIS in Azure VM

Following the code i'am using to connect to the FTP server.
client.Mode = FtpMode.Active;
client.ActiveModePorts = new Range(10000, 10001);
client.Connect(ftpModel.ftpServer, ftpModel.ftpPort);
client.Login(ftpModel.ftpUser, ftpModel.ftpPassword);
I'am using Ftp.dll nuget packaage for development.
The error Thrown by Visual Studio
FTP Firewall support
Firewall Inbound Rules
Inbound rules of Azure VM
Inbound rule in my local Machine
In Azure VM, we can't use FTP in active mode, please try to use passive mode.
In active mode FTP the client connects from a random unprivileged port (N > 1023) to the FTP server's command port, port 21. Then, the client starts listening to port N+1 and sends the FTP command PORT N+1 to the FTP server. The server will then connect back to the client's specified data port from its local data port, which is port 20.
Here is the connection appears as follows:

Client can connect to Server on same machine using localhost, but not when IP Address or hostname is used

I'm using VS Express 2012, setting up a simple server and client on a Windows Server 2008R2 machine with all of the latest updates installed. When I have the client try to connect to the running server using "localhost" as the host to connect to, everything works fine. When I have the client try to connect to the running server using the IP address or the actual host name, I see the "No connection could be made because the target machine actively refused it 192.168.5.159:13000 ..." error message. netstat shows my server is listening on the same port as reported in the error message (13000). I've modified the Windows Firewall setting to allow my client and server to communicate through the Windows Firewall. I've added an entry to my Hosts file associating my host name with the IP address. Any suggestions as to what else I can try? All of this is being done on a private (work) network.
Usually when you set up a server, you need to specify the hostname or IP the server listens on. When you initialize a server to use localhost, you can only use localhost to connect to it.
If you want a server to accept requests from every source you need to see if you can use a wildcard to accept all connections. For example 0.0.0.0 is used a lot.

Categories

Resources