# setting proxy



## hirohitosan (Jan 28, 2009)

Hi there.
How can I set the proxy permanent?
I did this:

```
# setenv http_proxy http://my.proxy.server:3128
```
but after logout or reboot I have to set it again
How can I set this permanent?

thanks


----------



## SirDice (Jan 28, 2009)

Add it to ~/.cshrc


----------



## Trojan (Apr 29, 2009)

FreeBSD runs squid and used as non-transparent proxy without any authentication. On another FreeBSD 6.3 machine in local network I added setenv http_proxy 192.168.100.1:3128 and setenv ftp_proxy 192.168.100.1:3128 in user/.cshrc and root/.cshrc. When I try to install any packet I get the next:


```
WS137# setenv http_proxy 192.168.100.1:3128 
WS137# setenv ftp_proxy 192.168.100.1:3128 
WS137# pkg_add -r nano 
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.3-release/Latest/nano.tbz: Protocol error 
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.3-release/Latest/nano.tbz' by URL
```

Even adding these variables in command line does not solve the problem. 

What can be the reason of it?


----------



## DutchDaemon (Apr 29, 2009)

You need to use 
	
	



```
http://192.168.100.1:3128/
```
not just ip addressort


----------



## Trojan (Apr 30, 2009)

This method also doesn't work.


```
WS137# setenv http_proxy http://192.168.100.1:3128  
WS137# setenv ftp_proxy http://192.168.100.1:3128  
WS137# pkg_add -r nano  
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.3-release/Latest/nano.tbz: Not Found  
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.3-release/Latest/nano.tbz' by URL
```

What I can try else?


----------



## DutchDaemon (Apr 30, 2009)

ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/*packages-6.3-release* does not exit. So your settings are probably correct, the directory just doesn't exist. You could try setting the PACKAGESITE environment variable (pkg_add(1)) to one of ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/ or ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.4-release/.


```
The environment variable PACKAGESITE specifies an alternate location for
     pkg_add to fetch from.  This variable subverts the automatic directory
     logic that pkg_add uses when the -r option is invoked.  Thus it should be
     a complete URL to the remote package file(s).
```

This may or may not work. Both 6-stable and 6.4-release are newer than your OS, so your installed packages may require newer libraries. Upgrading the OS to 6.4 is recommended.


----------

