Javascript WebSocket连接导致404

Javascript WebSocket连接导致404,javascript,html,google-chrome,websocket,Javascript,Html,Google Chrome,Websocket,我使用以下代码来建立 var socket = new WebSocket("ws://localhost:7701/subscribe/ZS"); socket.onopen = function() { alert("Connection established!"); }; 在后端,我有一个端点,它接受具有“subscribe/**”模式的WS-connections。当我尝试通过简单的WebSocket客户端(一个chrome扩展)测试WS-connection时,一切正常。

我使用以下代码来建立

var socket = new WebSocket("ws://localhost:7701/subscribe/ZS");

socket.onopen = function() {
    alert("Connection established!");
};
在后端,我有一个端点,它接受具有“subscribe/**”模式的WS-connections。当我尝试通过简单的WebSocket客户端(一个chrome扩展)测试WS-connection时,一切正常。我发现chrome向服务器发送了以下请求:

Request URL:ws://localhost:7701/subscribe/ZS
Request Method:GET
Status Code:101 
Request URL:http://localhost:7701/?url=ws%3A%2F%2Flocalhost%3A7701%2Fsubscribe%2FZS&ubofix=f41665f3028c7fd10eecf573336216d3
Request Method:GET
Status Code:404 
Remote Address:[::1]:7701
这正是我所期望的

但是,当我运行上述代码时,Chrome会向服务器发送一些奇怪的请求:

Request URL:ws://localhost:7701/subscribe/ZS
Request Method:GET
Status Code:101 
Request URL:http://localhost:7701/?url=ws%3A%2F%2Flocalhost%3A7701%2Fsubscribe%2FZS&ubofix=f41665f3028c7fd10eecf573336216d3
Request Method:GET
Status Code:404 
Remote Address:[::1]:7701
其中有一个url参数,它是
ws://localhost:7701/subscribe/ZS
。 因为这个服务器返回404

有人能给个提示吗?为什么Chrome会发送这样的请求?是否有任何方法只向“ws://localhost:7701/subscribe/ZS”发送请求