---
title: "Node Axios with a Proxy"
date: 2023-06-29T14:52:10.000Z
author: Z.SHINCHVEN
tags: [node, axios, proxy]
canonical: https://atlassc.net/2023/06/30/node-axios-with-a-proxy
---
Want to send http request via a proxy?

[Axios](https://axios-http.com/docs/intro) got you covered.

```TypeScript
import axios from 'axios';

const proxy = {
  protocol: 'http',
  host: '127.0.0.1',
  port: 7890,
  auth: {
    username: 'username',
    password: 'password',
  },
}

axios.get('http://your-api.com/',
  {
    proxy,
  }
)
  .then(res => {
    console.log(res.data)
  }).catch(err => console.error(err))
```
