chore(relay): 会话起始打印浏览器握手头(cookie/protocol/extensions/referer)用于诊断
This commit is contained in:
1 parent
8c7f87b58f
commit
bd35ca1c12
1 file changed
+7
@@ -506,6 +506,13 @@ WsServer.on('connection', (Client, Req) => {
|
||||
State.Log('=== 新客户端 ===');
|
||||
State.Log('来源: ' + (Req.socket.remoteAddress || '?') + ' Origin: ' + (Req.headers.origin || '无'));
|
||||
State.Log('模式: relay 上游: ' + UPSTREAM);
|
||||
// 诊断:浏览器发给中继的握手头(判断中继有没有漏带握手层信息)
|
||||
State.Log(
|
||||
'客户端握手头: cookie=' + (Req.headers['cookie'] ? '有(' + Req.headers['cookie'].length + 'B)' : '无') +
|
||||
' protocol=' + (Req.headers['sec-websocket-protocol'] || '无') +
|
||||
' extensions=' + (Req.headers['sec-websocket-extensions'] || '无') +
|
||||
' referer=' + (Req.headers['referer'] || '无'),
|
||||
);
|
||||
|
||||
const Decoders = { c2s: new StreamDecoder(State, 'c2s'), s2c: new StreamDecoder(State, 's2c') };
|
||||
let Upstream = null;
|
||||
|
||||
Reference in new issue
Block a user