IIS: Websocket and IIS sharing port 443

痞子三分冷 提交于 2020-01-24 00:20:09

问题


Is it possible with IIS 7.5 to host a secure https website on port 443 and to have a Java app run Socket.IO websocket on 443 also?

Currently we run the website on 443 and the secure websocket on another port 10001, but we are having issues with user firewalls and would like to move the websocket to a better "known default" port.

I know that IIS 8 has WebSocket capability but we would perfer not to have to upgrade our server instances to server 2012 unless we must.


回答1:


Two separate processes on a given IP address cannot both listen for the same incoming port. So, you can't have both IIS and a Java application listening for the same port. In addition, the webSocket protocol starts out as a web request (which the IIS server would handle) and then when certain "upgrade" headers are seen and both sides agree, the very same socket is then "upgraded" to the webSocket protocol which makes it hard to have two separate processes participating.

The only way I can think of to do this would be to build into IIS a "proxy" for webSocket. When an incoming connection to the IIS server has the webSocket upgrade headers, you would have to proxy that over to your Java application (on a different port) where it could then process things from there (while the actual socket continued to be proxied through IIS).

It is possible that there might be an actual product that could do this proxy separation that you could put in front of your IIS server to do this for you, but now I think you're getting enough complication that I'd wonder if you should really just go for the clean solution and upgrade.

Can you put the webSocket on port 80? Clients should be fine with that.



来源:https://stackoverflow.com/questions/28071948/iis-websocket-and-iis-sharing-port-443

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!