什么端口使用 stomp 协议?

What port use stomp protocol?

Spring 启动应用托管在默认端口 server.port=8080 上,当我连接到服务器时,JS 客户端的代码调用相同的端口 new SockJS('http://localhost:8080/api/streams'); 但在为 WebSocket 建立连接后使用端口?

我想 websocket\stomp 的数据交换在不同的端口上工作。但小麦是数字?

默认情况下,接受器元素配置为在端口 61616 和 61613 上接受 STOMP 连接。

https://activemq.apache.org/components/artemis/documentation/latest/stomp.html

WebSocket 使用 HTTP 连接,因此它可以使用该端口 8080,或更正常的端口 443(安全)或端口 80(不安全)连接。

通过建立 HTTP 连接,然后请求将连接升级为 WebSocket 连接来建立 WebSocket 连接。

正如Wikipedia所说:

WebSocket is distinct from HTTP. Both protocols are located at layer 7 in the OSI model and depend on TCP at layer 4. Although they are different, RFC 6455 states that WebSocket "is designed to work over HTTP ports 443 and 80 as well as to support HTTP proxies and intermediaries," thus making it compatible with HTTP. To achieve compatibility, the WebSocket handshake uses the HTTP Upgrade header to change from the HTTP protocol to the WebSocket protocol.