취소 :NodeJS와 Primus.io 웹 소켓 개방 핸드 셰이크 내가 프리머스 사용 WebSocket을 연결하기 위해 노력하고있어
WebSocket connection to 'wss://dev.dylaan.nl/primus/?_primuscb=1417355606238-6' failed: WebSocket opening handshake was canceled
내 NodeJS 스크립트 :
var express = require("express")
, fs = require("fs")
, path = require("path")
, moment = require("moment")
, Primus = require("primus")
, compression = require("compression")
, app = express()
, http = require("http").createServer(app)
, jsp = require("uglify-js").parser
, pro = require("uglify-js").uglify
, primus = new Primus(http, { transformer: "websockets" });
클라이언트 :
var primus = new Primus("wss://dev.dylaan.nl")
저는 이런 종류의 물건에 익숙하지 않지만, 지금 무엇이 잘못 됐는지를 모릅니다. 프리 머스 (Primus)의 문서를 읽었을 때, 나는 또한 구글을 시도했지만 대답을 찾을 수있다. 내가 ws
대신 wss
의에 프로토콜 변경하면
나는 오류를
Error during WebSocket handshake: Unexpected response code: 426
http 426 may mean that you are trying to connect with an unsupported websocket protocol version
Also, if you are connecting through a proxy, the proxy may remove the "upgrade" header from the request since it is marked as "connection" header. Switch to WSS:// to prevent that.
Unexpected response code: 426 with PhanthomJS Websocket client/ROSLIB
음 @, 내 VPS를 얻을 수 ngnix 역방향 프록시 뒤에 있습니다. 나는 그것에 접근 할 수 없다. 그래서 내가 왜 wss를 사용하고 있는지.
데모 : http://dev.dylaan.nl/play
누군가가 도와 드릴까요?
감사합니다.
저는 Primus 버전 2.4.10을 사용 중이며 클라이언트 라이브러리는 ws : // urls를 허용합니다. – op1ekun