PDA

Bekijk de volledige versie : Srelay - Simple proxy server setup



dp79
07-07-2009, 12:34
Hi,

I'm trying to setup a simple proxy server by using Srelay. For some reason it doesn't start. I get the following error message:


setsockopt: IPV6_V6ONLY: Protocol not available
no server socket prepared, exitting...
cannot open server socket

I use this config file:


# srelay.conf
# $Id: srelay.conf,v 1.3 2003/03/26 20:45:16 bulkstream Exp $
#
# dest[/mask] port proxy proxy-port
#; intranet
#158.116.xxx.yyy any 192.168.3.2 9091
#123.123.123.0/255.255.255.248 any 192.168.1.3
#2001:111:1:21::/64 1080 10.1.1.1
#:: 21-23 2001::240:2ff:fe3e:b2
#c-wind.com - x
0.0.0.0

Any advice is welcome!

dp79

wpte
07-07-2009, 19:17
you can turn on IPv6 in the webinterface.
You don't have to fill in everything, but just turn it on.
maybe that helps:)

otherwise search the tutorial forum for squid caching proxy, which works marvellous.

dp79
08-07-2009, 09:04
Hi,

Thanks for your tip. I turned ipv6 on, but unfortunately it didn't help. I read that squid requires a bit more decent hardware to run smoothly, meaning that on an asus wl500gP it is a bit slow. So this is the reason why I'm trying to get Srelay work, as it's more like a minimalist kind of software.
What I find weird is that there is not too much info about it online, so my two options are asking here and experimenting by myself ... :(

Thanks again!

dp79

wpte
08-07-2009, 22:21
Hi,

Thanks for your tip. I turned ipv6 on, but unfortunately it didn't help. I read that squid requires a bit more decent hardware to run smoothly, meaning that on an asus wl500gP it is a bit slow. So this is the reason why I'm trying to get Srelay work, as it's more like a minimalist kind of software.
What I find weird is that there is not too much info about it online, so my two options are asking here and experimenting by myself ... :(

Thanks again!

dp79

oh, but squid is not that havy!
I run it together with openvpn, when I use my phone as modem I connect to home and use the proxy for faster internet (about 300% speed increase on normal browsing:p)
here is the setup I use: http://wl500g.info/showthread.php?t=17287
note that there are a few things not spelled right here and there in the commands:p
but it works ok:)

there are also php proxy tools out there
the only thing you need is php-thttpd (php in combination with a webserver) and you are done:
http://www.iraqigeek.com/2007/01/21/modded-phproxy-05b2/
http://www.freeproxytemplates.com/

dp79
12-07-2009, 16:13
Hi wpte,

I set up squid, but there is a strange thing going on around this one too. I successfully set it up, It starts with no error message....But approx. 5 sec after the start it disappears from the list of running processes. Here is my config:


## SQUID CONFIG
cache_mgr myhidden@email-adress.com

## Those are the ports the proxy is going to listen to
http_port 192.168.3.2:9091

# TAG: visible_hostname
# The host-name of the proxy-server. Can really be anything
visible_hostname router

# DISK CACHE OPTIONS
# -----------------------------------------------------------------------------
# Disk-cache options. Just adjust the cache-size
cache_replacement_policy lru
cache_dir ufs /tmp/mnt/disc0_2/Squid/ 200 16 256
minimum_object_size 0 KB
maximum_object_size 200000 KB
maximum_object_size_in_memory 1024 KB

# MEMORY CACHE OPTIONS
# -----------------------------------------------------------------------------
# TAG: cache_mem (bytes)
cache_mem 8 MB
memory_replacement_policy lru

# ACCESS CONTROLS
# -----------------------------------------------------------------------------
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl our_networks src 192.168.1.0/24 192.168.2.0/24
acl to_localhost dst 127.0.0.0/8

http_access allow manager localhost
http_access allow manager our_networks
http_access deny manager

# Allow all clients from my network
http_access allow our_networks

# And finally deny all other access to this proxy
http_access deny all

#Allow ICP queries from everyone
icp_access allow all



# LOG-FILES
# -----------------------------------------------------------------------------
access_log /tmp/mnt/disc0_2/Squid/access.log squid

#cache_log none
#cache_log /opt/var/squid/logs/cache.log

#cache_access_log none
#cache_access_log /opt/var/squid/logs/access.log

#cache_store_log none
#cache_store_log /opt/var/squid/logs/store.log


# OPTIONS FOR TUNING THE CACHE
# -----------------------------------------------------------------------------

# TAG: cache
# A list of ACL elements which, if matched, cause the request to
# not be satisfied from the cache and the reply to not be cached.
# In other words, use this to force certain objects to never be cached.
#
# You must use the word 'DENY' to indicate the ACL names which should
# NOT be cached.
#
# Default is to allow all to be cached

#We recommend you to use the following two lines.
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
refresh_pattern .gif 1440 50% 40320 reload-into-ims
refresh_pattern .jpg 1440 50% 40320 reload-into-ims
refresh_pattern .tif 4320 50% 43200
refresh_pattern .png 1440 50% 40320 reload-into-ims
refresh_pattern .jpeg 1440 50% 40320 reload-into-ims
refresh_pattern ^http://*.google.*/.* 720 100% 4320

# refresh patterns to enable caching of MS windows update
refresh_pattern windowsupdate.microsoft.com/.*.(cab|exe|psf) 4320 100% 120960 reload-into-ims
refresh_pattern update.microsoft.com/.*.(cab|exe|psf) 4320 100% 120960 reload-into-ims
refresh_pattern office.microsoft.com/.*.(cab|exe|psf) 4320 100% 120960
refresh_pattern windowsupdate.com/.*.(cab|exe|psf) 4320 100% 120960 reload-into-ims
refresh_pattern download.microsoft.com/.*.(cab|exe|psf) 4320 100% 120960 reload-into-ims
refresh_pattern microsoft.com 4320 100% 10080


pipeline_prefetch on
# Apache mod_gzip and mod_deflate known to be broken so don't trust
# Apache to signal ETag correctly on such responses
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

# Leave coredumps in the first cache dir
coredump_dir /tmp/harddisk/Squid/cache

# Disable cachemgr password
cachemgr_passwd none all


I run my router in client mode. Any idea why it is quitting?

Thanks,

dp79

dp79
17-07-2009, 15:20
Hi,

I found out what the problem was. The permissions were not set correctly, since the user "nobody" has to be able to write in the cache directory and not only "root". Classic mistake from my side :( Now it works fine.
However, I'm still interested in getting srelay to run...

dp79

wpte
17-07-2009, 17:55
Hi,

I found out what the problem was. The permissions were not set correctly, since the user "nobody" has to be able to write in the cache directory and not only "root". Classic mistake from my side :( Now it works fine.
However, I'm still interested in getting srelay to run...

dp79

good to see that you made it working:)

I did another google on disabeling the srelay IPv6 function... but there is just little information about srelay:(
maybe you can compile your own version without support for IPv6.