gpt4 book ai didi

tomcat - Apache Tomcat 7 Websocket 端口

转载 作者:行者123 更新时间:2023-11-28 22:41:30 29 4
gpt4 key购买 nike

是否可以设置 Websocket 协议(protocol)来监听 Tomcat 7 的不同端口?从这里看不出什么:https://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html

最佳答案

根据 1.7. Relationship to TCP and HTTP 部分的 RFC 6455关于 WebSocket 协议(protocol):

The WebSocket Protocol is an independent TCP-based protocol. Its onlyrelationship to HTTP is that its handshake is interpreted by HTTPservers as an Upgrade request.

By default, the WebSocket Protocol uses port 80 for regular WebSocketconnections and port 443 for WebSocket connections tunneled overTransport Layer Security (TLS).

要更改 Apache Tomcat 中的 HTTP/WebSocket 端口,请打开 Apache Tomcat 的 server.xml 文件并搜索与此类似的条目:

<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000"
redirectPort="8443" />

8080 替换为所需的端口号,保存文件并重新启动 Apache Tomcat。

关于tomcat - Apache Tomcat 7 Websocket 端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32568862/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com