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

js2ray

Package Overview
Dependencies
Maintainers
0
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js2ray - npm Package Compare versions

Comparing version 2.3.8 to 2.3.9

2

package.json
{
"name": "js2ray",
"version": "2.3.8",
"version": "2.3.9",
"description": "The v2ray vmess protocol, based on nodejs javascript which you can use on hosts and servers",

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

@@ -31,3 +31,3 @@ "use strict";

app._staging = Buffer.alloc(0)
app._option = 0x05
// app._option = 0x05
app._cipherNonce = 0;

@@ -69,4 +69,4 @@ app._decipherNonce = 0;

app._isHeaderRecv = false;
app._adBuf.clear();
if (app._adBuf)
app._adBuf.clear();
app._adBuf = null;

@@ -115,2 +115,4 @@ app._host = null;

function EncodeRequestHeader(app, randomuser) {
if (!app._host)
return
const rands = crypto.randomBytes(33);

@@ -144,3 +146,2 @@ const [isAEAD, random_user, authInfo, ts] = randomuser();

app._v = rands[32];
app._option = 0x05;

@@ -150,5 +151,12 @@ const paddingLen = getRandomInt(0, 15);

app._security = app.user.security || 2
if (app.user.security == consts.SECURITY_TYPE_AUTO) {
app._security = consts.SECURITY_TYPE_CHACHA20_POLY1305
app._option = 0x0D;
} else if (app.user.security == consts.SECURITY_TYPE_ZERO) {
app._security = consts.SECURITY_TYPE_NONE
app._option = 0x00;
} else {
app._security = app.user.security || 2
app._option = 0x05;
}
if (app._security == consts.SECURITY_TYPE_CHACHA20_POLY1305) {

@@ -302,3 +310,3 @@ app._dataEncKeyForChaCha20 = common.createChacha20Poly1305Key(app._dataEncKey);

len = buffer.readUInt16BE(0);
if (app._option >= 0x05) {
if (app._option >= 0x05 && app._chunkLenDecMaskGenerator) {
var pad = 0

@@ -305,0 +313,0 @@ if (app._option >= 0x08) {

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

socket.app._staging = Buffer.alloc(0)
socket.app._option = 0x05
socket.app._isConnecting = false;

@@ -135,2 +134,3 @@ socket.app._isHeaderSent = false;

const securityType = reqHeader[35] & 0x0F;
app._security = securityType;
if (!(aeadUser.security == 2 || aeadUser.security == undefined || securityType == 2) && securityType != aeadUser.security) {

@@ -151,3 +151,3 @@ return onerror(app, `not match securety type`, 1);

var port = 0
var addr = "v1.mux.cool"
var addr = "localhost"
var addrType = ATYP_DOMAIN

@@ -205,3 +205,2 @@ }

const data = buffer.subarray(dataoffset + plainReqHeader.length + 4);
app._security = securityType;
app._isConnecting = true;

@@ -321,3 +320,2 @@ app.remote = remoteProtocol(

function onReceivingLength(buffer, app) {
var len = buffer.length

@@ -331,3 +329,3 @@ if (len < 2) {

var pad = 0
if (app._option >= 0x08) {
if (app._option >= 0x08 && app._chunkLenDecMaskGenerator) {
const padmask = app._chunkLenDecMaskGenerator.nextBytes(2).readUInt16BE(0);

@@ -334,0 +332,0 @@ pad = (padmask % 64)

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