# Fetch through proxy...strange



## eXa (Mar 30, 2010)

Hi,

I'm connected to internet trough a proxy, I've set the proxy in my conf like this:

```
export http_proxy='http://login:password@proxy.theadress.net:3128'
export ftp_proxy=$http_proxy
export ftp_passive_mode=YES
```
I can fetch by writing 
	
	



```
fetch http://google.com
```
for example.
But when I launch portupgrade, or portmaster it's says "Attempting to fetch" and then fail and try another address but always failing
I don't understand why portupgrade can't fetch if I can.


----------



## DutchDaemon (Mar 30, 2010)

http://forums.freebsd.org/showthread.php?t=10020


----------



## eXa (Mar 30, 2010)

He resolved his problem by setting is ftp same as http, right ?

```
export ftp_proxy=$http_proxy
```
Already done ...
But I found out that I can't fetch only when I sudo fetch, would that mean, that I have to set the proxy in root ?


----------



## DutchDaemon (Mar 30, 2010)

Doesn't look like it (unless you do something like [cmd=]sudo su -[/cmd] whch would change the environment)


```
$ export ftp_passive_mode=YES
$ echo $ftp_passive_mode
YES
$ sudo echo $ftp_passive_mode
YES
```

Not sure if this is the right example though 

From the sidoers file:


```
# Defaults specification
# Uncomment if needed to preserve environmental variables related to the
# FreeBSD pkg_* utilities and fetch.
#Defaults       env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR PACKAGEROOT PACKAGESITE PKGDIR [B]FTP_PASSIVE_MODE[/B]"

# Additionally uncomment if needed to preserve environmental variables
# related to portupgrade.
#Defaults       env_keep += "PORTSDIR PORTS_INDEX PORTS_DBDIR PACKAGES PKGTOOLS_CONF"
```

Then again:


```
$ export HTTP_PROXY="http://127.0.0.1:3128/"
$ echo $HTTP_PROXY
http://127.0.0.1:3128/
$ sudo echo $HTTP_PROXY
Password:
http://127.0.0.1:3128/
```


----------



## DutchDaemon (Mar 30, 2010)

`$ sudo HTTP_PROXY="http://login:password@proxy.theadress.net:3128" fetch some_site` might work.


----------



## eXa (Mar 30, 2010)

DutchDaemon said:
			
		

> `$ sudo HTTP_PROXY="http://login:password@proxy.theadress.net:3128" fetch some_site` might work.



Yeah it works this way, I've tried 
	
	



```
sudo HTTP_PROXY="http://login:password@proxy.theadress.net:3128" portupgrade -a
```
and now it works so I may upgrade my port that way with an alias I just have a small error about the time modification


----------

