Open
Description
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.