Skip to content

Pooling over a socks5 proxy does not work #3655

Open
@siddharthvp

Description

@siddharthvp

Example given in documentation (https://sidorares.github.io/node-mysql2/docs/documentation/extras#connecting-using-custom-stream) no longer works:

const mysql = require('mysql2');
const SocksConnection = require('socksjs');
const pool = mysql.createPool({
  database: 'test',
  user: 'foo',
  password: 'bar',
  stream: function (cb) {
    const newStream = new SocksConnection(
      { host: 'remote.host', port: 3306 },
      { host: 'localhost', port: 1080 }
    );
    cb(null, newStream);
  },
});

pool.query('SELECT 1')

gives:

Uncaught TypeError: cb is not a function

I couldn't figure out any way to pool over socks5 proxies, using either socksjs lib mentioned in the example (which had its last release 11 years ago) or with the more popular socks package.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions