Giter VIP home page Giter VIP logo

Comments (4)

wildan3105 avatar wildan3105 commented on August 23, 2024 1

Haha it's okay @danielschleindlsperger
Ah I see, thanks again ! 👍

from github-langs.

nutxeon avatar nutxeon commented on August 23, 2024 1

how to fix this
(node:12138) UnhandledPromiseRejectionWarning: Error: Request failed with status code 409
at createError (/root/node_modules/axios-https-proxy-fix/lib/core/createError.js:16:15)
at settle (/root/node_modules/axios-https-proxy-fix/lib/core/settle.js:18:12)
at IncomingMessage.handleStreamEnd (/root/node_modules/axios-https-proxy-fix/lib/adapter
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1221:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:12138) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error origit handled with .catch(). To terminate the node process on unhandled promise rejection, use trejection id: 220)

from github-langs.

wildan3105 avatar wildan3105 commented on August 23, 2024

Hi @danielschleindlsperger, thanks for the answer. Sadly, even I edited my code, still doesn't work. So do you think axios only provide https proxy?

from github-langs.

danielschleindlsperger avatar danielschleindlsperger commented on August 23, 2024

Hey @wildan3105! I got cold feet and deleted my answer 😅 , here's my changed code which works with a free proxy.

const axios = require('axios-proxy-fix');
const proxy = {
  host: '46.163.119.138',
  port: 3128,
}

axios.get('http://wildan.us', {proxy})
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });

Note that proxy is the key of a config object passed to axios.

Apparently axios is having some problems with this right now (referenced here: axios/axios#925).
One comment says to use the axios-proxy-fix package until they fix this which works for me.

from github-langs.

Related Issues (20)

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.