Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

socks

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socks - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

21

build/client/socksclient.js

@@ -293,2 +293,3 @@ "use strict";

sendSocks4InitialHandshake() {
const userId = this._options.proxy.userId || '';
const buff = new smart_buffer_1.SmartBuffer();

@@ -301,3 +302,3 @@ buff.writeUInt8(0x04);

buff.writeBuffer(ip.toBuffer(this._options.destination.host));
buff.writeStringNT(this._options.proxy.userId || '');
buff.writeStringNT(userId);
// Socks 4a (hostname)

@@ -310,3 +311,3 @@ }

buff.writeUInt8(0x01);
buff.writeStringNT(this._options.proxy.userId || '');
buff.writeStringNT(userId);
buff.writeStringNT(this._options.destination.host);

@@ -407,3 +408,3 @@ }

else if (data[1] === constants_1.Socks5Auth.UserPass) {
this.sendSocks5Authentication();
this.sendSocks5UserPassAuthentication();
}

@@ -416,13 +417,15 @@ else {

/**
* Sends Socks v5 auth handshake.
* Sends Socks v5 user & password auth handshake.
*
* Note: No auth and user/pass are currently supported.
*/
sendSocks5Authentication() {
sendSocks5UserPassAuthentication() {
const userId = this._options.proxy.userId || '';
const password = this._options.proxy.password || '';
const buff = new smart_buffer_1.SmartBuffer();
buff.writeUInt8(0x01);
buff.writeUInt8(Buffer.byteLength(this._options.proxy.userId));
buff.writeString(this._options.proxy.userId);
buff.writeUInt8(Buffer.byteLength(this._options.proxy.password));
buff.writeString(this._options.proxy.password);
buff.writeUInt8(Buffer.byteLength(userId));
buff.writeString(userId);
buff.writeUInt8(Buffer.byteLength(password));
buff.writeString(password);
this._socket.write(buff.toBuffer());

@@ -429,0 +432,0 @@ this.state = constants_1.SocksClientState.SentAuthenication;

@@ -6,2 +6,12 @@ "use strict";

const net = require("net");
function normalizeSocksClientOptions(options) {
options.proxy.userId = options.proxy.userId || '';
options.proxy.password = options.proxy.password || '';
}
function normalizeSocksClientChainOptions(options) {
options.proxies.forEach(proxy => {
proxy.userId = proxy.userId || '';
proxy.password = proxy.password || '';
});
}
/**

@@ -8,0 +18,0 @@ * Validates the provided SocksClientOptions

{
"name": "socks",
"version": "2.0.1",
"private": false,
"version": "2.0.2",
"description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.",

@@ -5,0 +6,0 @@ "main": "build/index.js",

@@ -119,7 +119,7 @@ /// <reference types="node" />

/**
* Sends Socks v5 auth handshake.
* Sends Socks v5 user & password auth handshake.
*
* Note: No auth and user/pass are currently supported.
*/
private sendSocks5Authentication();
private sendSocks5UserPassAuthentication();
/**

@@ -126,0 +126,0 @@ * Handles Socks v5 auth handshake response.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc