question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using with the brook proxy server

See original GitHub issue

I am trying to work with the google smtp server through the brook proxy server (https://github.com/txthinking/brook), here is the sample code:

let {SocksClient} = require('socks')

const options = {
  proxy: {
    ipaddress: '35.174.27.1',
    port: 1080,
    type: 5,
    userId: 'bouncedoc',
    password: 'password'
  },
  command: 'connect',
  destination: {
    host: 'gmail-smtp-in.l.google.com',
    port: 25
  }
};

(async function test () {
  let results = 0

  for (let i = 0; i < 20; i++) {
    let info = SocksClient.createConnection(options, (err, info) => {
      if (err) return console.error(err)
      info.socket.on('data', data => {
        console.log(data.toString())
        results += 1
      })
    })
  }
  setTimeout(() => {
    console.log(`${results}/20`)
  }, 3000)
})()

Running brook on aws in container:

docker run -d -e "ARGS=socks5 -l :1080 -i 0.0.0.0 --username bouncedoc --password password" -p 1080:1080 chenhw2/brook

Sometimes the data handler receives non-ascii chars, sometimes it completely fails with Received invalid Socks5 final handshake response. Expected receiving something like 220 mx.google.com ESMTP x37si5670929qtx.226 - gsmtp

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshGlazebrookcommented, Mar 9, 2018

The main change is buffering all incoming data in an internal receive buffer, and processing the next steps in the SOCKS handshake when all the required data is in the buffer. Then once the SOCKS handshake is done, any excess data received is emitted as a ‘data’ event on the socket itself, so nothing should be lost.

0reactions
JoshGlazebrookcommented, Mar 11, 2018

This was fixed by #26 and is published to npm at 2.1.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting Up V2Ray and Brook Proxy Servers | 101对双生儿's Blog
Enter 1 to start the installation of Brook proxy server. Choose a non-conflicting port number and a password, and use the default settings ......
Read more >
How to Create a Brook Server and Client on Ubuntu 20.04
Introduction. Brook is a cross-platform proxy server and client that provides strong encryption and resistance to detection.
Read more >
How to Use Brook on PC for Free Internet - Blog Tunneling
Blog.FastSSH.com — Brook is a cross-platform strong encryption and undetectable proxy. Brook's goal is to keep it simple and undetected.
Read more >
How the Brook and Shiliew GUI works - TxThinking
You can see the proxy mode in Proxy & Tun in the left menu of the graphical client. In this mode, it will...
Read more >
Brook Server - Howdy.id
Brook is a cross-platform strong encryption and not detectable proxy. Brook's goal is to keep it simple, stupid and not detectable.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found