簡體   English   中英

WebRTC Node.JS WebSocket 服務器,如果 WSS 參數不為 1,則阻止請求

[英]WebRTC Node.JS WebSocket Server, Block a Request if WSS Parameter is Not 1

如果PARAM不是 1,我希望節點 Web 套接字服務器(命令:節點/root/server.js)將拒絕連接。這樣的連接將被拒絕: wss://example.com/socket.io/?**PARAM**=**0**&EIO=3&transport=websocket

server.js 看起來像這樣(EasyRTC 框架): https://github.com/open-easyrtc/open-easyrtc/blob/master/server_example/server_ssl.js

我終於意識到它實際上並不是那么簡單(如果 PARAM.= 1 然后退出,則在 server.js 內部執行),任何人都可以確認這種復雜性或提供一個簡單的解決方案。 不推薦復雜的身份驗證框架。 也看不到 EasyRTC Framework 會提供這樣的東西。

因為我迷路了,有人能引導我朝着正確的方向前進嗎?

謝謝

我爬了所有EasyRTC群,有一個node server.js web socket的認證系統,很簡單:

var onAuthenticate = function(socket, easyrtcid, appName, username, credential, easyrtcAuthMessage, next){
// do your checks
next(null); // Run next with a null if they are allowed in / or if not the socket is "disconnected" for them not for others.
};
easyrtc.events.on("authenticate", onAuthenticate);

經過測試並完美運行。 接下來將進行更多測試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM