Skip to content

SOCKS proxy support for Thin Mode #253

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

Open
henzef opened this issue Nov 6, 2023 · 6 comments
Open

SOCKS proxy support for Thin Mode #253

henzef opened this issue Nov 6, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@henzef
Copy link

henzef commented Nov 6, 2023

I am currently using the Oracle JDBC driver via JayDeBeApi to connect to an oracle database, which is far from ideal. Unfortunately I have to make this connection via a SOCKS proxy for reasons outside of my control.
As I would like to port my application to python-oracledb, I am wondering if SOCKS proxy support is planned in the near or distant future?

@henzef henzef added the enhancement New feature or request label Nov 6, 2023
@anthony-tuininga
Copy link
Member

There aren't any current plans but it is on our list of enhancements. It would help if you can provide a bit more detail on what you think SOCKS proxy support might look like. Would it be as simple as adding an additional set of parameters: socks_proxy_host and socks_proxy_port? Or is the SOCKS proxy protocol important as well?

Have you tried monkeypatching as suggested by the PySocks documentation? Although not a good long-term solution it gives some indication of how much effort would be involved in adding this support.

@lassegit
Copy link

Or is the SOCKS proxy protocol important as well?

I would like to see this. Most other database clients implements this in one form or another allowing to setup a Socks proxy in front for static IP. I am actually using https://github.com/oracle/node-oracledb – but can't find any information/discussion in that repo.

@cjbj
Copy link
Member

cjbj commented Oct 26, 2024

@lassegit can you open an enhancement in that repo so it can be tracked there too?

@kyokley
Copy link

kyokley commented Apr 11, 2025

I would like to see this feature as well. I tried the suggestion to use PySocks to monkeypatch socket from the standard lib and was able to successfully make connections and run queries in thin mode. However, I'm working on an application that requires thick mode where, maybe unsurprisingly, monkeypatching does nothing. I'm new to working with OracleDB but my understanding is that in thick mode, an external client is used. Is it possible to add socks support there as well?

@anthony-tuininga
Copy link
Member

Thanks for confirming that monkeypatching works as expected for thin mode. You are correct that this will not work with thick mode, which requires the Oracle Client libraries. Why does your application require thick mode? It is always good to know what is preventing users from using thin mode -- which is the eventual end goal and is considerably more flexible among other advantages.

@kyokley
Copy link

kyokley commented Apr 14, 2025

Our application relies on TAC, at least, in production. Outside of production, we have some test databases on our network available for dev that I'm trying to connect to but, because of some networking issues, I'm unable to connect directly. I've been trying to get around those, hence the request for SOCKS.

For now, since I don't need TAC locally, I'm going to see if I can force our application to run in thin mode with the monkeypatch hack. Wish me luck 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants