简体   繁体   中英

WCF: How to configure net.tcp traffic on port 80

I have a WCF service that is configured to run for a high port number (eg 9000) on netTcpBinding. It all works, but only if the client can access data on that port. We've had a number of cases where corporate firewalls have not allowed us to connect on this port without a lot of pain.

Is there a way I can configure it to work on port 80 without affecting the web applications that are running on the server currently, so that most corporate environments don't need to change anything? I am aware of .net tcp port sharing, but this won't allow port 80 over net.tcp.

If it's not possible to configure net.tcp over port 80, are there any "best practices" for this kind of situation to minimize the firewall issues?

I suggest you could try port 8080 which is allowed in most firewalls. IIS 7.0 currently doesn't support sharing same port between different protocol binding. So HTTP + TCP on same port won't work.

You need to make sure that you bind to a specific ip. usually, when binding WCF services, people use 0.0.0.0 to accept on any ip. If you do that on port 80 or not specify a port, it will override all existing configurations in IIS, effectively killing all running sites.

The only way to do this is to have a separate IP that you can use for the port 80 binding, that the other sites are not using to connect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM