# Understanding how HTTP works

**URL:** <https://discourse.julialang.org/t/understanding-how-http-works/44980>\
**Category:** General Usage\
**Created:** [August 15, 2020, 9:08am UTC](https://discourse.julialang.org/t/understanding-how-http-works/44980 "2020-08-15T09:08:51Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 15, 2020, 11:09am UTC](https://discourse.julialang.org/t/understanding-how-http-works/44980/4 "2020-08-15T11:09:49Z")

</div>

There is some old discussion about HTTP.jl and proxy:

> [@Facing issue in HTTP.jl Proxy support](https://discourse.julialang.org/t/facing-issue-in-http-jl-proxy-support/30995):
>
> First of all, I would like to thank everyone who helped me to overcome the obstacles I faced in learning this beautiful and powerful programming language. slight_smile This time, the issue is regarding proxy in HTTP.get in HTTP.jl. r=HTTP.get("https://github.com/JuliaWeb", proxy="http://168.219.61.252:8080"); ERROR: HTTP.ExceptionRequest.StatusError(400, “CONNECT”, “[github.com](http://github.com):”, HTTP.Messages.Response: “”" HTTP/1.1 400 Bad Request Cache-Control: no-cache Pragma: no-cache Content-Typ…

Not sure if this still fits.  
I think the general way to solve this is using the environment variables:  
`http_proxy` , `https_proxy`

There is also a closed issue which shows some information on how to do it with linux/bash:

> <https://github.com/JuliaLang/julia/issues/30635>
>
> \- Original discussion: https://discourse.julialang.org/t/cannot-add-packages-may…be-due-to-corporate-firewall/19352.
> \- Asked to file a new issue from the related issue: https://github.com/JuliaLang/julia/issues/20948#issuecomment-452073028.
> 
> I am working behind a corporate firewall. The proxy settings to bypass the firewall are correct, but Julia package manager does not recognize the proxy settings.
> 
> I have the proxy settings in \`~/.bashrc\`, which read
> \`\`\`bash
> export http\_proxy=\<proxyhost\>:\<port\>
> export https\_proxy=\<proxyhost\>:\<port\>
> \`\`\`
> where \`\<proxyhost\>\` and \`\<port\>\` are replaced with the proxy host address and port number. This allows me to \`git clone\` a Julia package in BASH:
> \`\`\`bash
> $ git clone https://github.com/JuliaCI/BenchmarkTools.jl
> Cloning into 'BenchmarkTools.jl'...
> remote: Enumerating objects: 1230, done.
> remote: Total 1230 (delta 0), reused 0 (delta 0), pack-reused 1230
> Receiving objects: 100% (1230/1230), 310.90 KiB | 1.16 MiB/s, done.
> Resolving deltas: 100% (815/815), done.
> \`\`\`
> 
> However, in REPL the Julia package manager can neither read the package registry nor clone the package:
> \`\`\`julia
> julia\> VERSION
> v"1.2.0-DEV.93"
> 
> (v1.2) pkg\> add BenchmarkTools
> Cloning default registries into \`~/.julia\`
> Cloning registry from "https://github.com/JuliaRegistries/General.git"
> ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:OS, failed to connect to github.com: Operation timed out)
> 
> (v1.2) pkg\> add https://github.com/JuliaCI/BenchmarkTools.jl.git
> Cloning git-repo \`https://github.com/JuliaCI/BenchmarkTools.jl.git\`
> ERROR: failed to clone from https://github.com/JuliaCI/BenchmarkTools.jl.git, error: GitError(Code:ERROR, Class:OS, failed to connect to github.com: Operation timed out)
> \`\`\`
> 
> If I remove the proxy settings from \`~/.bashrc\`, I get a similar error message from \`git clone\` in BASH as well:
> \`\`\`bash
> $ git clone https://github.com/JuliaCI/BenchmarkTools.jl
> Cloning into 'BenchmarkTools.jl'...
> fatal: unable to access 'https://github.com/JuliaCI/BenchmarkTools.jl/': Failed to connect to github.com port 443: Operation timed out
> \`\`\`
> which suggests that the above error message is generated because Julia does not recognize the proxy settings.

---

_[View the full topic](https://discourse.julialang.org/t/understanding-how-http-works/44980)._
