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
Request to HTTPS with HTTP proxy fails #925
Comments
|
I'm having the same problem of https request over proxy. I do not want to move to request.js. Result: request.js and curl in this situation works well. Context
|
|
Me and a colleague of mine identified the problem, a PR should be coming soon |
|
the PR is here #959 |
|
Same issue here: Requesting https resources behind an http proxy. Result: |
|
Any progress on this so far? |
|
Same problem here. Any news ? |
|
My problem was not related to proxies tho, I had to send GET request to |
|
Same here, btw @mistermoe's PR works fine |
|
@mistermoe I just left work without making it succeeded :( I use this package : https://github.com/Yoctol/messaging-apis/tree/master/packages/messaging-api-messenger And if I replace "axios" by yours, the following error disappears: But I have something like: I notice that the Messenger plugin makes requests like that: client.get('...') Did you succeed by this way or not directly by Axios "request" function? Thanks! EDIT: Another one having this issue: |
|
Any chance of merging this? Could we leverage the newly added config.transport to avoid this issue? |
|
ups, same problem here! |
|
Unfortunately, this pull request doesn't merged, but I fixed this issue https://github.com/Sitronik/axios |
|
Had a similar issue recently, my solution was to use an HTTPS-over-HTTP tunnel, specify port 443 explicitly in the URL and disable automatic proxy detection in axios: import axios, { AxiosInstance } from 'axios';
import * as tunnel from 'tunnel';
const tunnel = tunnel.httpsOverHttp({
proxy: {
host: 'proxy.mycorp.com',
port: 8000,
},
});
const httpClient: AxiosInstance = axios.create({
baseURL: 'https://some.api.com:443',
httpsAgent: tunnel,
proxy: false,
});More about the solution in this article. Hope this helps, |
|
@jan-molak My fix is easy to use:
import axios from 'axios-https-proxy-fix';
const proxy = {
host: 'some_ip',
port: some_port_number,
auth: {
username: 'some_login',
password: 'some_pass'
}
};
async someMethod() {
const result = await axios.get('some_https_link', {proxy});
} |
|
@jan-molak's solution worked for me as well. It would really be nice to not have to force the port number on the url though. |
|
@jan-molak @Sitronik I tried your solution but get Error: socket hang up. |
|
Any chance to be included in 0.19.0? |
|
@astappev this definitely looks like it needs a fix ASAP. There's a lot of related issues and PRs that I need to sift through, but I'll add it to my 0.19.0 roadmap. |
|
tried all solution and all failed base on axios 0.18 |
|
You don’t need Nginx if you’re using request. Request handled proxies fine.
-
Anthony
… On Jan 17, 2019, at 8:44 PM, redbearder ***@***.***> wrote:
tried all solution and all failed base on axios 0.18
final solution :
install nginx module ngx_http_proxy_connect_module
then request https url via http proxy with request-promise
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thank you for reply |
|
2 years later, still broken!!! |
|
Use request promise.
Anthony
http://profullstack.com
… On Jul 18, 2019, at 7:05 AM, Yassien ***@***.***> wrote:
2 years later, still broken!!!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Here's what i did for those who stumble upon this and still want to use axios: const HttpsProxyAgent = require("https-proxy-agent"),
axios = require("axios");
const httpsAgent = new HttpsProxyAgent({host: "proxyhost", port: "proxyport", auth: "username:password"})
//use axios as you normally would, but specify httpsAgent in the config
axios = axios.create({httpsAgent});This will let you make https requests over an http proxy, simple and neat. |
|
Still having the same issue after 2 years. |
|
Just ran into this issue myself. Hoping you guys can fix this at some point. |
|
According to the 0.19.0 release, this has been fixed. Since it obviously hasn't, a new issue should be opened |
|
This functionality is still broken in axios 0.19. |
Updated other deps. Modernized code with async/await. Updated node versions to only include supported versions. Closes #189
Summary
Trying to do a HTTPS request with a HTTP proxy fails.
Results in:
The problem is already described by @chovy in this ticket, which ended up closed as OP did not have the same problem: #662
@chovy says:
### Context
The text was updated successfully, but these errors were encountered: