desproxy的功能就是一级代理+端口映射
对本地指定的一个端口的请求会经过代理送到远程的主机
远程主机是代理服务器的话就实现了二级代理的功能:)
对本地指定的一个端口的请求会经过代理送到远程的主机
远程主机是代理服务器的话就实现了二级代理的功能:)
- 怎样获得Desproxy?
http://desproxy.sourceforge.net/
页面最下面右下角,有一个project page的链接
真正的下载页面是
http://sourceforge.net/project/showfiles.php?group_id=30464&release_id=90041
现在有三个平台的支持,windows,linux和macos,我们就用linux吧 - 安装
下载后获得一个desproxy-0.1.0-pre1.tgz文件(很快的,只有55k)
推荐使用root安装,不会碰到什么麻烦
解压:得到desproxy目录,进入这个目录
$tarzxvfdesproxy-0.1.0-pre1.tgz
如果在./configure时,遇到错误
$./configure
$make
$makeinstall
checking for C compiler default output... configure: error: C compiler cannot create executables
可能是库的问题,通过如下方法解决:
sudoapt-getinstalllibc6-dev
- desproxy的一般用法是如果第一级代理proxy_host:proxy_port需要简单的用户密码验证(desproxy只支持简单的验证)
$desproxyremote_hostremote_portproxy_hostproxy_portlocal_port
使用全局变量来设置:就可以设置浏览器通过127.0.0.1:local_port来通过两层代理浏览
exportPROXY_USER=username:password
Establishing proxy...
-----------------------------------
desproxy 0.1.0-pre3
(C) 2003 Miguelanxo Otero Salgueiro
-----------------------------------
TCP port 8080 Bound & Listening
Press <Control+C> to Quit
Connection request from 127.0.0.1, port 1135
Connecting to http proxy (xxx.xxx.xxx.xxx:8080)
Connection #0: bidirectional connection stablished
Connection #0: client -> proxy 522 bytes read
Connection #0: proxy -> client 1448 bytes read
Connection request from 127.0.0.1, port 1137
Connecting to http proxy (xxx.xxx.xxx.xxx:8080)
Connection #1: bidirectional connection stablished -
启动脚本和配置文件
----------------/etc/init.d/desproxy------------------------
#!/bin/bash
if[!-x/usr/local/bin/desproxy];then
echo"Missingdesproxyexecfile!Maynotinstalledproperly."
exit0
fi
if[!-f/etc/desproxy.conf];then
echo"Missingconfigurationfile!"
exit0
fi
./etc/desproxy.conf
start_desproxy(){
if[-n"$(ps-eo"%a"|grep/usr/local/bin/desproxy
|grep-vgrep)"];
then
echo"Desproxyhasalreadyrun!"
exit0
fi
envPROXY_USER=$PROXY_USER/usr/local/bin/desproxy$REMOTE_SERVER
$REMOTE_PORT$PROXY_SERVER$PROXY_PORT$LOCAL_PORT
1>/var/log/desproxy.log2>&1&
echo"Desproxyisrunningnow!"
}
stop_desproxy(){
DESPROXYPID=$(ps-eo"%p%a"|grep/usr/local/bin/desproxy
|grep-vgrep)
kill-15$DESPROXYPID1>/dev/null2>&1
echo"Desproxyisterminated!"
}
case"$1"in
start)
start_desproxy
;;
stop)
stop_desproxy
;;
restart)
stop_desproxy
start_desproxy
;;
*)
echo"Usage:/etc/init.d/desproxy{start|stop|restart}"
exit1
esac
exit0
----------------------------/etc/desproxy.conf-----------------------
PROXY_USER=xxxxxx:xxxxxxxxx
REMOTE_SERVER=xxx.xxx.xxx.xxx
REMOTE_PORT=xxxx
PROXY_SERVER=xxxx.xxx.xxx.xxx
PROXY_PORT=xxxx
LOCAL_PORT=xxxx
本文介绍Desproxy代理服务器的安装及配置流程,包括下载、安装步骤、常见问题解决方法及如何实现多级代理功能。此外还提供了启动脚本与配置文件示例。
16万+

被折叠的 条评论
为什么被折叠?



