Bypass proxy

You have a problem with Salix? Post here and we'll do what we can to help.
User avatar
antmon
Posts: 130
Joined: 26. Nov 2009, 16:49

Bypass proxy

Post by antmon »

Hello!
I am using our favorite OS in my company as I can. Because there is a proxy that I can only authenticate using the browser. I can't connect with gslapt. Is there a work around this!?
Thanks!
Image
djemos
Salix Warrior
Posts: 1464
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: Bypass proxy

Post by djemos »

How do I specify proxy settings?

slapt-get takes advantage of the normal http_proxy and ftp_proxy shell
variables. Here are some examples:

1) First Way
# setting the env variables for the entire session
export http_proxy=http://host:port
export ftp_proxy=ftp://host:port
# just setting them for the current command invocation
http_proxy=http://host:port slapt-get --update

If you are using ~/.netrc, libcurl automatically picks up your preferences.
See the netrc(5) manpage for more information.

2) Second Way

You need to edit the configuration file
/etc/slapt-get/slapt-getrc

and add the following lines to the file.
The heading should look like this:

#setting the env variables for the entire session
export http_proxy=http://host:port
export ftp_proxy=ftp://host:port

Please report if either or both ways work.
User avatar
antmon
Posts: 130
Joined: 26. Nov 2009, 16:49

Re: Bypass proxy

Post by antmon »

Hello djemos!
As I have to authenticate to the proxy I only tried:
# just setting them for the current command invocation
http_proxy=http://host:port@user@domain:password slapt-get --update
And the response was:
...Failed to download: couldn't resolve proxy name
Does this makes any sense?
Thanks.
Image
djemos
Salix Warrior
Posts: 1464
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: Bypass proxy

Post by djemos »

antmon wrote:Hello djemos!
As I have to authenticate to the proxy I only tried:
# just setting them for the current command invocation
http_proxy=http://host:port@user@domain:password slapt-get --update
Where is host:port you have to write your real proxy name host and port
not the words host:port
for example http_proxy=http://proxy.forthnet.gr:8080 for proxy forthnet.gr server in Greece.
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Bypass proxy

Post by Shador »

The right syntax is explained here:
http://ubuntuforums.org/showthread.php?t=1575
Image
User avatar
antmon
Posts: 130
Joined: 26. Nov 2009, 16:49

Re: Bypass proxy

Post by antmon »

Where is host:port you have to write your real proxy name host and port
not the words host:port
for example http_proxy=http://proxy.forthnet.gr:8080 for proxy forthnet.gr server in Greece.
I did all the substitution. My problem is that I have to authenticate in the form off a mail for username. I am about to try Shador tip. I have reported this problem earlier and gapan told me to escape the '@' symbol. But still can't pass the proxy.
Image
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: Bypass proxy

Post by JRD »

replace the '@' in your email adresse with '%40'
Image
User avatar
antmon
Posts: 130
Joined: 26. Nov 2009, 16:49

Re: Bypass proxy

Post by antmon »

Tried it all with no success. I think it's all about finding the right string to send to the proxy to authenticate. The ones I tried and obtained a "couldn't resolve proxy name" from the proxy were:

Code: Select all

user:password
user@domain.pt:password
user%40domain.pt:password
user\@domain.pt:password
I just wrote here the authentication part. I know that apt doesn't have this problem. I tried Debian and in the proxy configuration I just entered:
http_proxy=http://host:port@user@domain.pt:password slapt-get --update
I just remenbered that I have a '$' in my password. Going to test it. What is the diference between the '%40' and '\40'?
Image
User avatar
gapan
Salix Wizard
Posts: 6362
Joined: 6. Jun 2009, 17:40

Re: Bypass proxy

Post by gapan »

antmon wrote:I just remenbered that I have a '$' in my password.
That is definitely a problem. $ is a special character that defines variables. If you need to use it, you must escape it. Try this to see what I mean:

Code: Select all

this="that"
echo $this
echo \$this
antmon wrote:What is the diference between the '%40' and '\40'?
The first one means the @ character, the other one is an escaped 4 followed by a 0.
Image
Image
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Bypass proxy

Post by Shador »

Just do it like that:

Code: Select all

export http_proxy='http://username:password@host:port/'
The single quotes should be the key. Like that it already worked perfectly for me in the past. I don't had any weird characters in my password though. (Why is there a magical preference for '$' in passwords?? :D)

Anyway I hope you understand that this export will only affect the HTTP protocol and only applications launched from the SAME shell AFTER the variable has been exported.

For example:

Code: Select all

# export http_proxy='http://username:password@host:port/'
# slapt-get -u
Image
Post Reply