0
私は、WSクライアントのITを追跡する方法を把握しようとしているのNode.jsNode.jsに 'ws'を使用すると、どのようにしてクライアント情報を取得できますか?
var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({
port: 8080
});
wss.on('connection', function connection(conn) {
conn.on('message', function incoming(message) {
console.log('<--', message);
});
conn.send('something');
});
// Console will print the message
console.log('-=-=- Server running :8080 -=-=-');
のためのWSを使用して簡単なのWebSocketサーバーを設定しました。たとえば、クライアントのIPアドレスを取得するにはどうすればよいですか?私は基本的に、私はwss.on('connection'...
イベントにconsole.log(conn.IpAdress)
に
これは完全に機能しました!どのようにそれを把握しましたか? –
偉大なgit hub documentation – Adiii
私はそれを2時間梳きました。あなたはどこで手掛かりを得たのですか? –