Closed wujohns closed 3 months ago
because the agent module 'https-proxy-agent' works fine, but 'https-proxy-agent' is not instanceof http.Agent
May I make a pr for this?
because the agent module 'https-proxy-agent' works fine, but 'https-proxy-agent' is not instanceof http.Agent
https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/src/index.ts#L44 https://github.com/TooTallNate/proxy-agents/blob/main/packages/agent-base/src/index.ts#L29
because the agent module 'https-proxy-agent' works fine, but 'https-proxy-agent' is not instanceof http.Agent
https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/src/index.ts#L44 https://github.com/TooTallNate/proxy-agents/blob/main/packages/agent-base/src/index.ts#L29
emmmmm,but the example code not work..... I just try to find the way which can work
because the agent module 'https-proxy-agent' works fine, but 'https-proxy-agent' is not instanceof http.Agent
https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/src/index.ts#L44 https://github.com/TooTallNate/proxy-agents/blob/main/packages/agent-base/src/index.ts#L29
The main problem is the npm module 'proxy-agent' has bug, even their code is beautiful but not work at all
my agent object is below:
const HttpsProxyAgent = require('https-proxy-agent')
const httpAgent = new HttpsProxyAgent('http://127.0.0.1:7890')
const wsAgent = new HttpsProxyAgent('http://127.0.0.1:7890')
const client = new Client({
http: { agent: httpAgent },
ws: { agent: wsAgent }
})
this agent can link the discord server correctly and using the proxy which I set
when using npm module 'proxy-agent' the link to discord always failed The code below not work:
const { ProxyAgent } = require('proxy-agent')
const httpAgent = new ProxyAgent('http://127.0.0.1:7890')
const wsAgent = new ProxyAgent('http://127.0.0.1:7890')
const client = new Client({
http: { agent: httpAgent },
ws: { agent: wsAgent }
})
for this example: https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/examples/Proxy.js
But:
commit: https://github.com/wujohns/discord.js-selfbot-v13/commit/1db27dd03444938cb483ddf6406c325a6555b5b4
I will review it later
when using npm module 'proxy-agent' the link to discord always failed The code below not work:
const { ProxyAgent } = require('proxy-agent') const httpAgent = new ProxyAgent('http://127.0.0.1:7890') const wsAgent = new ProxyAgent('http://127.0.0.1:7890') const client = new Client({ http: { agent: httpAgent }, ws: { agent: wsAgent } })
for this example: https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/examples/Proxy.js
So....Why is my side operating normally?
when using npm module 'proxy-agent' the link to discord always failed The code below not work:
const { ProxyAgent } = require('proxy-agent') const httpAgent = new ProxyAgent('http://127.0.0.1:7890') const wsAgent = new ProxyAgent('http://127.0.0.1:7890') const client = new Client({ http: { agent: httpAgent }, ws: { agent: wsAgent } })
for this example: https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/examples/Proxy.js
So....Why is my side operating normally?
maybe your network can link the discord directly, in my side it's always timeout
when using npm module 'proxy-agent' the link to discord always failed The code below not work:
const { ProxyAgent } = require('proxy-agent') const httpAgent = new ProxyAgent('http://127.0.0.1:7890') const wsAgent = new ProxyAgent('http://127.0.0.1:7890') const client = new Client({ http: { agent: httpAgent }, ws: { agent: wsAgent } })
for this example: https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/examples/Proxy.js
So....Why is my side operating normally?
maybe your network can link the discord directly, in my side it's always timeout
hmm why https-proxy-agent
works fine. it's so strange
i checked both sides and it's pretty much the same. hmmm
In proxy-agent
proxy-agent does not work. https-proxy-agent works but its slower apparently. So yes, the example does not work.
The proxy.js example does not work
Which package has the bugs?
The core library
Issue description
The proxy example not work
Code sample
No response
Package version
3.1.4
Node.js version
v18.14.2
Operating system
No response
Priority this issue should have
High (immediate attention needed)
Checklist
Additional Information
I have reviewed the code, and find the bug reason: