-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Issue description
MongoDB connector ignores SOCKS5 proxy settings, both passed in url or in extra.
Expected Behavior
Passing proxyHost and proxyPort in the connection URL or inside the extra object should work.
Actual Behavior
Passing proxyHost and proxyPort in the connection URL or inside the extra object does not work (they both get ignored).
Steps to reproduce
Setup a SOCKS5 tunnel listening at localhost:27017, the try connecting by passing proxyHost and proxyPort either in the connection URL or inside the extra option.
My Environment
| Dependency | Version |
|---|---|
| Operating System | Any |
| Node.js version | >=16 |
| Typescript version | >=4 |
| TypeORM version | 0.3.17 |
Additional Context
I fixed it just by adding the following fields in the validOptionNames field:
proxyHostproxyPortproxyUsernameproxyPassword
These fields are documented (and I confirm they are working) in the currently supported version of the driver (5.2) as well as in the latest version of the driver (6.3), so this change should be safe enough as it will work when TypeORM will support version >6.
Relevant Database Driver(s)
- aurora-mysql
- aurora-postgres
- better-sqlite3
- cockroachdb
- cordova
- expo
- mongodb
- mysql
- nativescript
- oracle
- postgres
- react-native
- sap
- spanner
- sqlite
- sqlite-abstract
- sqljs
- sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.