" WebSocket在建立连接之前关闭"使用feathersjs

时间:2017-10-29 07:01:35

标签: javascript node.js websocket feathersjs

我在本地工作的quasar聊天应用程序中有羽毛js。然后我转移到远程服务器,现在我一直在浏览器控制台中收到此错误: WebSocket connection to 'ws://mydomain.com:8089/socket.io/?EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established.

我可以ping服务器,netstat告诉我以下内容:

tcp6       0      0 :::8089                 :::*                    LISTEN      0          191916      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57168    CLOSE_WAIT  0          216624      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57740    CLOSE_WAIT  0          216636      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55256    LAST_ACK    0          0           -               
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:54280    LAST_ACK    0          0           -               
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:56086    LAST_ACK    0          0           -               
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57496    CLOSE_WAIT  0          216629      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55182    LAST_ACK    0          0           -               
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:54774    LAST_ACK    0          0           -               
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57414    CLOSE_WAIT  0          216626      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55552    LAST_ACK    0          0           -               
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:56808    CLOSE_WAIT  0          216615      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:56342    CLOSE_WAIT  0          216606      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55470    LAST_ACK    0          0           -               
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:56594    CLOSE_WAIT  0          216613      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:56174    CLOSE_WAIT  0          216604      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:54848    LAST_ACK    0          0           -               
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55884    LAST_ACK    0          0           -               
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55796    LAST_ACK    0          0           -               
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:54366    LAST_ACK    0          0           -               
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:58310    ESTABLISHED 0          216782      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:56428    CLOSE_WAIT  0          216608      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57980    CLOSE_WAIT  0          216640      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55630    LAST_ACK    0          0           -               
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57902    CLOSE_WAIT  0          216638      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57086    CLOSE_WAIT  0          216619      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:57574    CLOSE_WAIT  0          216631      22828/node      
tcp6       0      0 <server-ip-address>:8089     <client/local-ip-address>:58066    CLOSE_WAIT  0          216643      22828/node      
tcp6       0      1 <server-ip-address>:8089     <client/local-ip-address>:55104    LAST_ACK    0          0           -       

所以我认为它已被倾听,但尝试时无法真正连接。

从另一台计算机输出nmap:

nmap -P0 <serverip>

Not shown: 994 closed ports
PORT     STATE    SERVICE
25/tcp   open     ssh
135/tcp  filtered msrpc
139/tcp  filtered netbios-ssn
445/tcp  filtered microsoft-ds
8080/tcp open     http-proxy
8089/tcp open     unknown

使用netcat:

nc -vz <serverip> 8089
Connection to <serverip> 8089 port [tcp/*] succeeded!

我没有使用websockets的经验。我选择Primus用ws作为websockets。

有什么问题,因为我无法正常连接?

0 个答案:

没有答案