I have a server pc with Windows Server 2008.and i also have a wcf service that work with Port 8525 and host it with Windows Service.i open the port in server firewall (Added Rule).
My server machine has a Valid IP. so my client try to connect to my service at
((http)://MyServerIP:8525/ServiceName).
all of my application users are people that work in companies.so user internet come from a secure network (Proxy Server Or VPN Connection).
the problem is here :
lots of my clients have the connection problem that seems local network block my program connection (if they try to connect to my server system.diagnostics listener will log it) but service does not save any log.
i think their internet Server has Firewall and it block me.i fixed some of them with
<defaultProxy enabled="true" useDefaultCredentials="true" />
but still lots of them have same problem.and the another annoying problem is the network administrators do not open that port because of security issue and do not help me.
A Common Exception is :
System.ServiceModel.EndpointNotFoundException > System.Net.WebException > System.Net.Sockets.SocketException (on client Side).
this problem did not occur when i connect from home.
My question :
any way to fix this issue with c# code or client app.config? or at least fix this with some change in service config (server side).
The only easy solution is to host that service on port 80
The problem is that some networks do not permit outgoing connection to ports other than permitted services(http,https,pop, etc etc)
Or you can ask sysadmins of those networks to permit traffic to your ip/port
If you have iis on that server you could host wcf on iis.
Remenber that only one process can bind to a port on an address at any one time.
there you can find some info: How can a WCF service listen the same port as IIS?
Related
Have a server with a public IP address and windows server 2019. configured a VPN and when I try to access it through the VPN, signalR is not working.
if I access it through the public IP address it works.
I've got the firewall in off position.
if I go through the VPN it doesn't work.
more information:
all files are in the webserver (js )
doesn't give any error
I cannot see in Fidler anything strange.
VPN don't provide internet access.
See if the ports signalR is using are not blocked in firewall or VPN
I have C# TCP Server program which is running into VMWare and network type is NAT. There TCP server works as a http server, so that I can connect it using browser. Now when I am connecting it using this url http://localhost:33333/OrderDetails, it works without any problem. But when I am trying to connect it from outside of VMWare using this link http://1.39.37.243:33333/OrderDetails (1.39.37.243 is my PC's public ip), then its not working. I can't change the network type NAT, because my customer's office Network system is also NAT system. Where am I doing it wrong ? Any thoughts or suggestion will be highly appreciated.
This isn't working because the machine receiving the TCP packets has no reason to forward them to the VM. In other words, this isn't working because you haven't done anything to make it work.
You need to configure VMWare's NAT to forward these incoming TCP connections to the VM.
You could also have other problems:
The server might not be listening on the right IP address. For example, if the listening socket is bound to localhost, only localhost connections will work.
There might be something else in the path keeping the TCP packets from getting to the host. For example, if the host itself is behind NAT, port forwarding may need to be configured in the router.
Port forwarding won't work from inside the LAN unless the router supports hairpinning. If the host itself is behind NAT, test from outside the LAN after setting up port forwarding in the router.
I am working on a big enterprise environment. When i try to deploy my solution to remote sever using ms build i get this error every time i try to deploy the app.
According to the error message it says it cannot connect but i can ping to the ip. I have even added the host ip and names in both machines host files. I don't know if i am doing anything wrong has anyone come across this before.How did you overcome this?
Note: i have replaced my ip with myip.com... and site name as my site name in this question.(My app is Asp.net MVC 4 Application)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (3847): Web deployment task failed.(Could not complete the request to remote agent URL 'https://myip.com/msdeploy.axd?site=my site name'.) This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server. Error details: Could not complete the request to remote agent URL 'https://myip.com/msdeploy.axd?site=my site name'. Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond myip.com
Any help will really be appriciated
The real error message is buried in the report, but it reads:
"Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond myip.com"
This is a TCP connection problem, which means there's probably a simple solution.
It should be straightforward: it means the server you've specified is not operational. If you're certain that your website is currently working (i.e. you can get to it from your web-browser) then it means you've mistyped the server's name or other connection details. It does not mean that msdeploy.axd is having problems because if it were, your client would at least be able to connect.
Check your server's firewall rules, and also ensure that the web server (IIS) is running and is actively listening on the IP address you want (check the site bindings and also the server's network configuration, a dump of ipconfig /all would also be useful).
It was the issue with IIS it was not allowing remote connections. fixed it by allowing remote connections.
In my case it was due to the firewall setting of the host machine. Turning off firewall for local network fixed the problem
I'm writing an application with both a desktop and a mobile app component. The desktop app is being written in c#, and I'd like to be able to open it up to act as a server for the mobile app (similar to what AirVideo does). How can I accomplish this without requiring the user to configure their firewall and/or router?
Ideally, I want to self host a restful wcf service in the desktop app. I've tried this already, but the automatic configuration of the firewall doesn't allow remote connections to the wcf service, since it appears to be hosted by the system process. Is there a workaround for this behavior?
Edit: I've solved the router problem as best I can through the use of the NATUPnP COM library (http://pietschsoft.com/post/2009/02/05/NET-Framework-Communicate-through-NAT-Router-via-UPnP.aspx). I still need to know how to allow remote connections through the firewall to a self-hosted WCF service without any manual configuration of the firewall (I'm okay with the user prompt to allow connections once the app is launched).
Set a specific port in your router that is designated to route to your server address,
So if your router real ip is a.b.c.d, you should set up that all communication to a.b.c.d:port# is being routed to your server local address. (a.b.c.d:port# --> serverIP)
The settings for this can be achieved from your router configuration.
In a situation where you cannot tinker with the router setting/firewall settings:
This means you cannot use ports to listen to incoming connections and can only use outgoing connections. to overcome that you will have to use a 3rd server with real IP-Address which will function as a listener for both sides. Typical scenario can be described as follows:
Client Side - A (Desktop)
Client Side - B (Smartphone)
Server Side - S (Communications Server)
S --> Open port for listening to incoming connections.
A --> Connect to S every x seconds to check if requests to do something are waiting.
B --> Connect to S. (issues a waiting request for A)
That way S is served as a proxy to glue both sides' communications.
I've written a server using HttpListener that works perfectly well for requests sent from the same computer, but doesn't even receive requests sent from a remote machine. I've tried using (including registering with netsh) the following prefixes: http://*:8080/, http://+:8080/, http://localhost:8080/, and the specific IP address of the host computer followed by port 8080. (I also made sure no other applications were using 8080.) I opened up the appropriate ports in the firewall, and when that didn't work, I turned off the firewall just to see if it was a firewall issue and that also had no affect on the problem. I have no idea what to try next, please help!
Also, the machine running this web service is a Amazon Web Services Microsoft Windows Server 2008 R2 with SQL Server Express and IIS EC2 instance.
If you are using AWS free tier EC2 instance, adding the given public elastic IP as the prefixes will not work for you even after you have the local firewall port and ports in security group opened. The HTTPListener needs to be bind with the public DNS provided by AWS. Then only it will work.
For future users, the solution in more detail was to add an Inbound Custom TCP rule that included port 8080 in the 'Port range:' to a Security Group used by my EC2 instance.
thanks to #shashankaholic for pointing that out