raspiworld
Posts: 3
Joined: Thu Sep 27, 2012 7:45 pm

Connect Raspi to a Proxy

Thu Sep 27, 2012 7:52 pm

Hi, I have a problem with my internet connectivity.
I only have acces to the Internet over a proxy server. When I try to visit a website with the browser, it works, because of the proxy settings of the browser.

But when I want to install new software, there is no connection to the Internet, when I tipe in "apt-get update" for example.

Is there any posibility or setting to get access to the internet over a proxy?


Thank you!

Wendo
Posts: 142
Joined: Sun Jun 10, 2012 8:27 pm

Re: Connect Raspi to a Proxy

Sat Sep 29, 2012 2:22 am

Add the following lines to the file /etc/environment

export http_proxy="http://username:password@host:port/"

phughes
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK

Re: Connect Raspi to a Proxy

Tue Oct 02, 2012 10:09 am

Hi,

Very new to this. I have tried to edit the file as you have said, no authentication required.

export http_proxy=http://proxy.county.ac.uk:8080

This doesn't seem to do anything. Did you get it working??

Cheers,
Pete

User avatar
VAXXi
Posts: 9
Joined: Tue Sep 25, 2012 12:04 pm
Location: Romania
Contact: Website

Re: Connect Raspi to a Proxy

Tue Oct 02, 2012 11:10 am

apt seems to ignore the HTTP_PROXY environment variable.

You can make it work by putting

Code: Select all

Acquire::http::Proxy "http://yourproxyaddress:proxyport";
in a file placed in /etc/apt/conf.d (named similar to "10proxy" for example). It should also work when placed in /etc/apt/apt.conf but I don't remember if this file still exists on the latest Raspbian.

phughes
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK

Re: Connect Raspi to a Proxy

Tue Oct 02, 2012 12:23 pm

Hi,

Thanks for the reply. Looks promising, but i'm not quite sure where exactly to add the line.

The structure i have is as follows;

/etc/apt/ - contains 3 files (sources.list, trustdb.gpg & trusted.gpg)
/etc/apt/apt.conf.d - contains 3 files (70debconf, 50raspi & 01autoremove)
/etc/apt/preferrences.d - empty
/etc/apt/sources.list.d - 1 file (raspi.list)
/etc/apt/trusted.gpg.d - empty

Do I create a new file or use one of these?

Many thanks,
Pete

User avatar
VAXXi
Posts: 9
Joined: Tue Sep 25, 2012 12:04 pm
Location: Romania
Contact: Website

Re: Connect Raspi to a Proxy

Tue Oct 02, 2012 12:25 pm

Create a new file in /etc/apt/apt.conf.d/ and name it "10proxy"; put inside the long line in my above post. Apt-get should work immediately after.

phughes
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK

Re: Connect Raspi to a Proxy

Tue Oct 02, 2012 12:44 pm

Wonderful. Thank you :)

phughes
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK

Re: Connect Raspi to a Proxy

Wed Oct 03, 2012 1:24 pm

Internal proxy. For internet use.

I'm getting an error using dillo; DNS failed to resolve domain\username

I have changed the file /etc/environment to read as follows;

Code: Select all

export http_proxy="http://domain\username:password@proxyip:port/"
This looks like a syntax error with my code, any suggestions?

Cheers,
Pete

phughes
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK

Re: Connect Raspi to a Proxy

Thu Oct 04, 2012 7:16 am

Hi Guys,

Dillo doesn't like proxy servers I dont think. The above code works perfectly fine on the other richer browsers.

Cheers,
Pete

raspiworld
Posts: 3
Joined: Thu Sep 27, 2012 7:45 pm

Re: Connect Raspi to a Proxy

Fri Oct 05, 2012 3:53 pm

Hi guys,
I tried to go to the directory using "cd /etc/apt/apt.conf.d" but the terminal says "Not a directory"
To create the "10proxy" file there I have to go in there.
Cut and paste doesn't work, too. (Permission denied)

If I try to move the file to the Folder "apt.conf.d" using "mv 10proxy /etc/apt/apt.conf.d" the file goes to "/etc/apt" and get the name "apt.conf.d".

I don't understand this. I just want to have a Internet connection on my Raspi.

Many thanks

User avatar
VAXXi
Posts: 9
Joined: Tue Sep 25, 2012 12:04 pm
Location: Romania
Contact: Website

Re: Connect Raspi to a Proxy

Fri Oct 05, 2012 7:54 pm

Not sure about what Linux distribution you're using, but try adding a "/" at the end of the path (after apt.conf.d) and prefix the commands with sudo in order to make sure it's not a permission problem.

raspiworld
Posts: 3
Joined: Thu Sep 27, 2012 7:45 pm

Re: Connect Raspi to a Proxy

Mon Oct 08, 2012 9:41 pm

Worked fine.

Thank you!

tsantosc123
Posts: 1
Joined: Thu Jan 23, 2014 12:21 am

Re: Connect Raspi to a Proxy

Thu Jan 23, 2014 12:37 am

Hello, I've created the "10proxy" file and put the line said by VAXXi in it, but I still can't access apt.
I think it's because I need an username and password to connect in my proxy server.

There's something I can do to include the username and password?

Thank you.

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Connect Raspi to a Proxy

Thu Jan 23, 2014 1:01 am

At a guess

Code: Select all

Acquire::http::Proxy "http://yourusername:yourpassword@yourproxyaddress:yourproxyport";
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jneha
Posts: 8
Joined: Sat May 24, 2014 7:26 am

Re: Connect Raspi to a Proxy

Mon May 26, 2014 2:59 pm

VAXXi wrote:apt seems to ignore the HTTP_PROXY environment variable.

You can make it work by putting

Code: Select all

Acquire::http::Proxy "http://yourproxyaddress:proxyport";
in a file placed in /etc/apt/conf.d (named similar to "10proxy" for example). It should also work when placed in /etc/apt/apt.conf but I don't remember if this file still exists on the latest Raspbian.


Thank you. the apt-get works in my Raspi by setting the proxy.. Thank you :)

Chanderjeet
Posts: 5
Joined: Tue Feb 09, 2016 2:57 pm

Re: Connect Raspi to a Proxy

Tue Mar 08, 2016 11:50 am

I used these steps to get proxy up and running -

viewtopic.php?f=28&t=136554&p=907699#p907699


then I create a blank file named 10proxy under /etc/apt/apt.conf.d and added this line :

Acquire::http::Proxy "http://yourproxyaddress:proxyport";



It works like charm !

netitux
Posts: 3
Joined: Sun Mar 08, 2015 5:15 pm

Re: Connect Raspi to a Proxy

Wed Apr 20, 2016 4:03 pm

This works! Thanks!

nageshub
Posts: 2
Joined: Thu Nov 10, 2016 4:42 pm

Re: Connect Raspi to a Proxy

Thu Nov 10, 2016 5:03 pm

I have a similar kind of problem, where in I am connecting pi2 with raspbian Jesse to a college network having proxy server. I had set proxy in 10proxy file and everything is working fine as am able to ping google.com and all other servers. But when I try to connect to cayenne iot wget link, it shows ' resolving' and fails to connect even many tries after timeout. Am able to connect to this link in my desktop.
Can anybody help.....?

nageshub
Posts: 2
Joined: Thu Nov 10, 2016 4:42 pm

Re: Connect Raspi to a Proxy

Sun Nov 13, 2016 4:18 pm

Before anyone, I solved this problem myself. Just have to add proxy to wget in /etc/wgetrc

asmaa_alsousy
Posts: 1
Joined: Wed Apr 26, 2017 11:57 am

Re: Connect Raspi to a Proxy

Mon Oct 30, 2017 8:41 am

nageshub wrote:
Sun Nov 13, 2016 4:18 pm
Before anyone, I solved this problem myself. Just have to add proxy to wget in /etc/wgetrc
HI
my raspberry pi can see the WIFI but cannot connect to it
it required a pre shared key
I entered the password of WIFI, but it still seem not connected.
there is a proxy and I dont know how to add it to the raspberry pi3
can you please explain how to add proxy to wget.
thanks very much
:)

atulkrishna
Posts: 2
Joined: Tue Mar 13, 2018 7:38 pm

Re: Connect Raspi to a Proxy

Tue Mar 13, 2018 7:43 pm

For connecting Raspi to a proxy server you can follow this blog. It works fine for me.
[https://theailearner.com/2018/03/13/con ... xy-server/]

GodSaveTheDoge
Posts: 4
Joined: Fri May 03, 2019 3:48 pm

Re: Connect Raspi to a Proxy

Mon May 20, 2019 4:56 pm

How can i connect to a proxy with raspberry pi 3 b+
It's a socks5 proxy, not http.
(host is 127.0.0.1, the port is 9050)
I have raspbian.

(yep it's tor)

bricolodu13
Posts: 38
Joined: Tue Aug 07, 2012 2:05 pm

Re: Connect Raspi to a Proxy

Sat Jun 22, 2019 6:42 pm

Hello The community :D !

I have a Pi 3B+ and a Zero W that both can wirelessly connect to a proxy : Fine
Both can ping Google, both can do apt-get update : Fine

BUT :
I have on these Pi LogitechMediaServer that is running and none of my Pi can connect to any internet Radio or Streaming plateform from the LMS when the Pi are connected to the Proxy.
I have the very same issue with other applications that need an internet connection.

Note that if connected to a non Proxy connection, LMS and any other applications can connect to Internet

So there should be some sort of indication to provide somewhere so that LMS can ALSO connect to Internet from the Proxy connection

:?: Any idea ?

Thank you for your help.
Jean

Return to “Troubleshooting”