Skip to content

Commit

Permalink
js: DriverRemoteConnection: allow custom agent (#2240)
Browse files Browse the repository at this point in the history
Allow users to provide their own http.Agent when initialising
DriverRemoteConnection.

This is extremely helpful connecting to databases within a corporate
network.
  • Loading branch information
itsjfx authored Sep 28, 2023
1 parent 896e75e commit ca5b9c8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This release also includes changes from <<release-3-6-5, 3.6.6>> and <<release-3
* Added new data type `DT` to represent periods of time.
* Added Gherkin support for Date.
* Added list filtering functions `all` and `any`.
* Added `agent` parameter to `DriverRemoteConnection` options to allow a user-provided `http.Agent` implementation.
[[release-3-7.0]]
=== TinkerPop 3.7.0 (Release Date: July 31, 2023)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Client {
* @param {Boolean} [options.pingEnabled] Setup ping interval. Defaults to: true.
* @param {Number} [options.pingInterval] Ping request interval in ms if ping enabled. Defaults to: 60000.
* @param {Number} [options.pongTimeout] Timeout of pong response in ms after sending a ping. Defaults to: 30000.
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
* @constructor
*/
constructor(url, options = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class Connection extends EventEmitter {
* @param {Boolean} [options.pingEnabled] Setup ping interval. Defaults to: true.
* @param {Number} [options.pingInterval] Ping request interval in ms if ping enabled. Defaults to: 60000.
* @param {Number} [options.pongTimeout] Timeout of pong response in ms after sending a ping. Defaults to: 30000.
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
* @constructor
*/
constructor(url, options) {
Expand Down Expand Up @@ -132,6 +133,7 @@ class Connection extends EventEmitter {
cert: this.options.cert,
pfx: this.options.pfx,
rejectUnauthorized: this.options.rejectUnauthorized,
agent: this.options.agent,
});

this._ws.on('message', (data) => this._handleMessage(data));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class DriverRemoteConnection extends RemoteConnection {
* @param {Boolean} [options.pingEnabled] Setup ping interval. Defaults to: true.
* @param {Number} [options.pingInterval] Ping request interval in ms if ping enabled. Defaults to: 60000.
* @param {Number} [options.pongTimeout] Timeout of pong response in ms after sending a ping. Defaults to: 30000.
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
* @constructor
*/
constructor(url, options = {}) {
Expand Down

0 comments on commit ca5b9c8

Please sign in to comment.