Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
Axios Proxy Request net::ERR_CONNECTION_REFUSED

Tried to send an HTTP POST request through Axios with a proxy server as an intermediary, it returns the following error

POST http://localhost:7777/client-app/client/login net::ERR_CONNECTION_REFUSED

First I set up a proxy server by creating an SSH tunnel

ssh -D 5001 username@x.x.x.x

then to create a proxy server listening on 8081

hpts -s 127.0.0.1:5001 -p 8081

At this point I made a request through Postman and everything works fine but when I make a JS script with Axios to send the same POST request

axios.post(
    serverSide.login,
    {
        client_id: this.form.username, 
        password: this.form.password
    },
    {
        proxy: {
            protocol: 'http',
            host: '127.0.0.1',
            port: 8081,
            auth: {
                username: 'someusername',
                password: 'somepassword'
            }
        }
    }
).then((res) => {
    // do something here
})

doing so causes the aforementioned error. Any idea what causes the issue and how to debug it?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda