Skip to content

Commit

Permalink
refactor: update onNotification.js to use HttpsProxyAgent for proxyin…
Browse files Browse the repository at this point in the history
…g the WebSocket connection
  • Loading branch information
Prioq committed Oct 21, 2024
1 parent 8673c92 commit f60361a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
4 changes: 2 additions & 2 deletions lib/client/onNotification.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const WebSocket = require('ws');
const events = require('events');
const { HttpProxyAgent } = require('http-proxy-agent'); // For proxying the WebSocket connection
const { HttpsProxyAgent } = require('https-proxy-agent'); // For proxying the WebSocket connection

// Includes
const getSession = require('../util/getSession.js').func;
Expand Down Expand Up @@ -50,7 +50,7 @@ exports.func = function (args) {

// If a proxy URL is provided, use it
if (args.proxyUrl) {
const proxyAgent = new HttpProxyAgent(args.proxyUrl);
const proxyAgent = new HttpsProxyAgent(args.proxyUrl);
options.agent = proxyAgent;
}

Expand Down
59 changes: 36 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"entities": "^5.0.0",
"figlet": "^1.7.0",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"postman-request": "^2.88.1-postman.34"
},
"license": "MIT",
Expand Down

0 comments on commit f60361a

Please sign in to comment.