Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: axios
node v10.24.1
endpoint
share
tweet
const axios = require('axios') const http = require('http') const PROXY_PORT = 8080 // A fake proxy server http.createServer(function (req, res) { res.writeHead(302, {location: 'http://example.com'}) res.end() }).listen(PROXY_PORT) axios({ method: "get", url: "https://www.google.com/", proxy: { host: "localhost", port: PROXY_PORT, }, }) .then((r) => console.log(r.data)) .catch(console.error)
Created from: https://npm.runkit.com/axios
Loading…
Clone and edit this document