Page 1 of 2

Bypass proxy

Posted: 18. Jan 2011, 11:57
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!

Re: Bypass proxy

Posted: 18. Jan 2011, 12:51
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.

Re: Bypass proxy

Posted: 18. Jan 2011, 17:17
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.

Re: Bypass proxy

Posted: 18. Jan 2011, 18:13
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.

Re: Bypass proxy

Posted: 18. Jan 2011, 18:35
by Shador
The right syntax is explained here:
http://ubuntuforums.org/showthread.php?t=1575

Re: Bypass proxy

Posted: 19. Jan 2011, 14:37
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.

Re: Bypass proxy

Posted: 19. Jan 2011, 14:58
by JRD
replace the '@' in your email adresse with '%40'

Re: Bypass proxy

Posted: 20. Jan 2011, 12:24
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'?

Re: Bypass proxy

Posted: 20. Jan 2011, 21:54
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.

Re: Bypass proxy

Posted: 20. Jan 2011, 22:29
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