MCPcopy
hub / github.com/microsoft/playwright / _run

Method _run

packages/utils/socksProxy.ts:96–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94 }
95
96 async _run() {
97 assert(await this._authenticate());
98 const { command, host, port } = await this._parseRequest();
99 if (command !== SocksCommand.CONNECT) {
100 this._writeBytes(Buffer.from([
101 0x05,
102 SocksReply.CommandNotSupported,
103 0x00, // RSV
104 0x01, // IPv4
105 0x00, 0x00, 0x00, 0x00, // Address
106 0x00, 0x00 // Port
107 ]));
108 return;
109 }
110
111 this._socket.off('data', this._boundOnData);
112 this._client.onSocketRequested({ uid: this._uid, host, port });
113 }
114
115 async _authenticate(): Promise<boolean> {
116 // Request:

Callers 1

constructorMethod · 0.95

Calls 7

_authenticateMethod · 0.95
_parseRequestMethod · 0.95
_writeBytesMethod · 0.95
assertFunction · 0.90
offMethod · 0.65
onSocketRequestedMethod · 0.65
fromMethod · 0.45

Tested by

no test coverage detected