Skip to content

Commit

Permalink
deps: socks@2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Mar 2, 2022
1 parent f342192 commit 1dd2f7e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
17 changes: 10 additions & 7 deletions node_modules/socks/build/client/socksclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SocksClient extends events_1.EventEmitter {
super();
this.options = Object.assign({}, options);
// Validate SocksClientOptions
helpers_1.validateSocksClientOptions(options);
(0, helpers_1.validateSocksClientOptions)(options);
// Default state
this.setState(constants_1.SocksClientState.Created);
}
Expand All @@ -40,7 +40,7 @@ class SocksClient extends events_1.EventEmitter {
return new Promise((resolve, reject) => {
// Validate SocksClientOptions
try {
helpers_1.validateSocksClientOptions(options, ['connect']);
(0, helpers_1.validateSocksClientOptions)(options, ['connect']);
}
catch (err) {
if (typeof callback === 'function') {
Expand Down Expand Up @@ -89,7 +89,7 @@ class SocksClient extends events_1.EventEmitter {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
// Validate SocksClientChainOptions
try {
helpers_1.validateSocksClientChainOptions(options);
(0, helpers_1.validateSocksClientChainOptions)(options);
}
catch (err) {
if (typeof callback === 'function') {
Expand All @@ -103,7 +103,7 @@ class SocksClient extends events_1.EventEmitter {
let sock;
// Shuffle proxies
if (options.randomizeChain) {
util_1.shuffleArray(options.proxies);
(0, util_1.shuffleArray)(options.proxies);
}
try {
// tslint:disable-next-line:no-increment-decrement
Expand All @@ -113,7 +113,8 @@ class SocksClient extends events_1.EventEmitter {
const nextDestination = i === options.proxies.length - 1
? options.destination
: {
host: options.proxies[i + 1].ipaddress,
host: options.proxies[i + 1].host ||
options.proxies[i + 1].ipaddress,
port: options.proxies[i + 1].port,
};
// Creates the next connection in the chain.
Expand Down Expand Up @@ -549,7 +550,8 @@ class SocksClient extends events_1.EventEmitter {
}
sendSocks5CustomAuthentication() {
return __awaiter(this, void 0, void 0, function* () {
this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size;
this.nextRequiredPacketBufferSize =
this.options.proxy.custom_auth_response_size;
this.socket.write(yield this.options.proxy.custom_auth_request_handler());
this.setState(constants_1.SocksClientState.SentAuthentication);
});
Expand Down Expand Up @@ -581,7 +583,8 @@ class SocksClient extends events_1.EventEmitter {
authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2));
}
else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) {
authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));
authResult =
yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));
}
else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) {
authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size));
Expand Down
Loading

0 comments on commit 1dd2f7e

Please sign in to comment.