mrluanma / shadowsocks-heroku

shadowsocks over WebSocket, support Heroku.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RangeError: The value "63342" is invalid

olliecheng opened this issue · comments

Hello,
shadowsocks-heroku throws this error (but continues to work):

RangeError [ERR_INVALID_OPT_VALUE]: The value "63342" is invalid for option "value"
    at checkInt (buffer.js:1229:11)
    at Buffer.writeInt16BE (buffer.js:1417:5)
    at Socket.<anonymous> (C:\Users\olive\Documents\Programming\arcane-proxy\local.js:190:15)
    at Socket.emit (events.js:159:13)
    at addChunk (_stream_readable.js:265:12)
    at readableAddChunk (_stream_readable.js:252:11)
    at Socket.Readable.push (_stream_readable.js:209:10)
    at TCP.onread (net.js:598:20)

The infringing line is this: buf.writeInt16BE(remotePort, 8);. remotePort = data.readUInt16BE(5 + addrLen);. Changing writeInt to writeUInt fixes the issue.