Git Product home page Git Product logo

simple-proxy-agent's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jufab avatar zjael avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

simple-proxy-agent's Issues

Mysterious 421 Misdirected Request Error

I'm getting weird 421 error and I think it's related to simple proxy agent since after switching agent to https://github.com/TooTallNate/node-proxy-agent exact same code works fine.

image

Only certain webservers produce this error (github is one of them), I guess it has something to do with HTTP2 and/or SNI.

I've tried to debug it via tcpdump but I don't see any major differences between two agents in protocol..

Steps to reproduce:

const fetch = require('node-fetch')
const ProxyAgent = require('simple-proxy-agent')

const TSProxyAgent = require('https-proxy-agent');




url = 'https://raw.githubusercontent.com/imakewebthings/waypoints/master/licenses.txt'

addrProxy2 = "http://any-proxy-http-or-socks"

let agent = ProxyAgent(addrProxy2)



console.log ('421 redirect err')
fetch(url, {agent})
.then(async (resp) => {
    console.log(resp)
})
.catch(err => {
    console.error(err)
})
.finally(() => {


    let agent2 = TSProxyAgent(addrProxy2)

    console.log('200 OK with tootallnate agent:')
    fetch(url, {agent: agent2})
    .then(async (resp) => {
        console.log(resp)
    })
    .catch(err => {
        console.error(err)
    })

})

wrong socks5h handling

    let lookup = false;
    switch (this.proxy.protocol) {
      case 'socks4:':
      case 'socks5h:':      // this line is wrong,  should be 'socks5:' instead
        lookup = true;
        break;
    }

See urllib3/urllib3#1035,
Quote: In a proxy string, socks5h:// and socks4a:// mean that the hostname is
resolved by the SOCKS server, not the client

node internal/process/esm_loader 108 internalBinding('errors').triggerUncaughtException(false Thrown at at loadESM

Hi Dev,
I have an issue with this. I am not able to catch this exception in try catch block.

node:internal/process/esm_loader:108
    internalBinding('errors').triggerUncaughtException(
                              ^
false
Thrown at:
    at loadESM (node:internal/process/esm_loader:108:31)

Node.js v19.0.0

This exception occurs sometimes when I connect to a faulty proxy or a proxy with wrong address.
I just want to catch this error but its not getting caught in try catch.
I am using this agent with Got request module.
Is there any workaround for solving this ?

Thanks
Regards
User

Error when making a request through socks proxies

I keep getting the following error when making requests through socks proxies :
SocksClientError: An invalid destination host was provided.

My request looks like this :

const ProxyAgent = require('simple-proxy-agent');
// p is a proxy that looks like 'socks://79.xxx.xx.xxx:4153'
const res = await needle('get', 'https://google.com', {
    agent: new ProxyAgent(p),
    follow: 10,
    response_timeout: 10000,
    read_timeout: 5000,
}).catch(e => e);

Any ideas on why this could be happening ?

Issues with Authenticated Proxies

It seemed like I was having no issues using this project but I just noticed that it seems to fail with authenticated proxies (user:pass@ip:port). Not sure if this is a common issue but when I try doing this I receive a FetchError message that looks like this:
"request to https://google.com/ failed, reason: Client network socket disconnected before secure TLS connection was established"

The code is ECONNRESET. The errno is also ECONNRESET and the type is system. Not sure why this happens but any help fixing this issue would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.