Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use a proxy server to proxy all Database calls? #1011

Open
balexandre opened this issue Dec 11, 2019 · 7 comments
Open

How can I use a proxy server to proxy all Database calls? #1011

balexandre opened this issue Dec 11, 2019 · 7 comments
Labels
Q&A For non-issues. General Q&A

Comments

@balexandre
Copy link

balexandre commented Dec 11, 2019

Just like in mysql2 database driver, how can we use a proxy server to route calls?

Hosting in a dynamic IP provider (like Heroku) and have an Azure Database (that requires a whitelist IP address) it's almost impossible unless you open all IP range, and that goes against the propose of the firewall ...

I was wondering if there is a non-documented way to connect to a proxy (or socket proxy)

Added for linking proposes, the same kind'a question was asked on Sequelize

@MichaelSun90
Copy link
Contributor

Hi @balexandre, unfortunately, I do not think there is a way to form a proxy connection using tedious. I try to search around, and I did not find any related modules that can help with this purpose. 😓

@arthurschreiber
Copy link
Collaborator

In theory that would be possible - we'd just have to allow passing in a custom stream instead of opening up a socket for communication.

@IanChokS IanChokS added the Q&A For non-issues. General Q&A label Dec 13, 2019
@ghost
Copy link

ghost commented May 19, 2020

Теоретически это было бы возможно - нам просто нужно было бы разрешить передачу пользовательского потока вместо открытия сокета для связи.

100%

@ygoyal25
Copy link

Hi,
Is there any plan to add the custom stream to use a proxy server for connection?

@Thenkei
Copy link

Thenkei commented Oct 5, 2023

Same issue here. While trying to use a reverse-proxy and proxy-socks.

at Login7TokenHandler.onErrorMessage (/node_modules/tedious/lib/token/handler.js:245:19)
      at Readable.<anonymous> (/node_modules/tedious/lib/token/token-stream-parser.js:26:33)
      at Readable.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:324:12)
      at readableAddChunk (node:internal/streams/readable:297:9)
      at Readable.push (node:internal/streams/readable:234:10)
      at next (node:internal/streams/from:98:31)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {

@martin-d-aleksandrov
Copy link

Hi Folks,
we are interested in connecting to MSSQL over SOCKS proxy as well. Any way to achieve that? How about using the custom connector example - https://github.com/tediousjs/tedious/blob/master/examples/custom-connector.js?

Thanks,
Martin

@MichaelSun90
Copy link
Contributor

Hi @martin-d-aleksandrov, I have not worked with SOCKS before. If it returns a Node.js Stream compatible stream, then the custom connector should work for this case. I think the discussion here may provide a additional explanation on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Q&A For non-issues. General Q&A
Projects
None yet
Development

No branches or pull requests

7 participants