Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call API behind proxy #5607

Closed
lynn901213 opened this issue Jun 22, 2020 · 1 comment
Closed

Call API behind proxy #5607

lynn901213 opened this issue Jun 22, 2020 · 1 comment

Comments

@lynn901213
Copy link

lynn901213 commented Jun 22, 2020

Hi,

I am facing an issue to call apis behind corporate proxy to AWS backend server. I need to deploy the vue.js frontend on a corporate network, which has proxy setup for security reasons. In order to send http request to outside network, the request has to go through the proxy. So far I have tried 4 things

  1. use axios 'proxy' param
    let ax = axios.create(proxy: {host: , port: })
    ax({method: 'get', url: }.then(...).catch(...))

  2. use https agent
    const HttpsProxyAgent = require('https-proxy-agent');
    const axiosDefaultConfig = {
    proxy: false,
    agent: new HttpsProxyAgent('')
    };
    const ax = require('axios').create(axiosDefaultConfig);
    ax({method: 'get', url: }.then(...).catch(...))

  3. https tunnel

  4. using fetch instead of axios, and add https agent to fetch.

None of them works to pass the api through proxy. I am not getting an error message in any case, and by pulling out the network log I knew the api was never attempt to send through proxy. It is always from my local machine directly to the aws server.

@vue-bot
Copy link

vue-bot commented Jun 22, 2020

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants