• 大小: 392KB
    文件类型: .gz
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: 其他
  • 标签: 代理  linux  socks5  socks  

资源简介

socks5 代理软件 配置在linux 下的socket5代理 2。解压缩软件包   #tar xvfz socks5-v1.0r11.tar.gz   3.开始编译   #cd socks5-v1.0r11   #./configure --with-threads   #make   #make install   4.建立/etc/socks5.conf,其实在软件包里已经有现成的examples   #cd examples   #cp socks5.conf.singlehomed /etc/socks5.conf (我们挑选一个最简单的配置文件)   默认配置就是   # A Socks5 Config file for a normal, single homed server   permit - - - - - -   这个配置文件是允许任何人都可以使用这个socks5代理,并不需要验证      如果想限制只是某个IP段(192.168.0.0/255.255.255.0)可以访问,可以改成   permit - - 192.168.0. - - -   或者只允许某个IP(192.168.0.10)可以访问使用,可以改成   permit - - 192.168.0.10 - - -   5.ok 运行一下socks5 -t 启动socks5服务,然后用QQ测试一下代理是否生效,记住默认端口是1080   反正我是在FTP软件和QQ上试了 都没问题。      6.如果要停止socks5,只要运行stopsocks -KILL就行,socks5就会停止!      7.使用非默认端口:如果你想让socks5服务启动的时候不启动默认监听端口1080,比如为1234,我们可以运行如下命令   socks5 -b 1234 -t 当然你关掉这个服务,就必须用下面的命令 stopsocks -p 1234 -KILL   8.我们来深入配置一下socks5.conf,使socks5使用用户验证机制      要使用用户验证,首先要建立/etc/socks5.pwsswd文件      内容为:(userA代表用户名。passwdA代表用户userA的密码)   #/etc/socks5.passwd   userA passwdA   userB passwdB   userC passwdC   然后修改/etc/socks5.conf   添加下列语句   auth - - u   或者把:   auth - - -改成auth - - u   添加:      把默认permit - - - - - - 改成permit u - 192.168.0. - - -      即允许来自192.168.0.0/255.255.255.0网段的任何经过用户认证的连接      如果你不想把密码文件存在默认的/etc/socks5.passwd里。想存在自定义的文件,比如/etc/qq.passwd      那就得修改/etc/socks5.conf.添加一项参数   set SOCKS5_PWDFILE /etc/qq.passwd   ok!重启一下服务,这时如果不输入正确的用户名和密码是使用不了socks5代理服务器的,输入正确的用户名和密码便可使用。      以上说的参数,大家可以结合使用,比如限制某个IP段使用socks5服务,而且要使用用户名验证      另外针对/etc/socks5.conf还有一些参数,大家就自己去研究吧   set SOCKS5_BINDINFC 192.168.0.8:1080   忽略ident请求。当客户机没有运行identd时,使用SOCKS5_NOIDENT将降低超时值   set SOCKS5_NOIDENT      指定连接停顿最长时间。超过最大值后,socks5断开连接   set SOCKS5_TIMEOUT 15      socks5将接受SOCKS V4 协议的请求,默认不接受   set SOCKS5_V4SUPPORT      指定同时存在的最大子进程数,Socks5预设为64   set SOCKS5_MAXCHILD 4

资源截图

代码片段和文件信息

/*                                                                           */
/*  * aquery.c : Programmatic Prospero interface to Archie                   */
/*  *                                                                        */
/*  * Copyright (c) 1991 by the University of Washington                     */
/*  *                                                                        */
/*  * For copying and distribution information please see the file          */
/*  * .                                                         */

#include “pmachine.h“
#include “pfs.h“
#include “perrno.h“
#include “archie.h“

static void translateArchieResponse();
inline static int hostnamecmp();

extern int pwarn;
extern char p_warn_string[];

/*                                                                           */
/*  * archie_query : Sends a request to _host_ telling it to search for     */
/*  * _string_ using _query_ as the search method.                           */
/*  * No more than _max_hits_ matches are to be returned                     */
/*  * skipping over _offset_ matches.                                        */
/*  *                                                                        */
/*  * archie_query returns a linked list of virtual links.                   */
/*  * If _flags_ does not include AQ_NOTRANS then the Archie                */
/*  * responses will be translated. If _flags_ does not include              */
/*  * AQ_NOSORT then the list will be sorted using _cmp_proc_ to            */
/*  * compare pairs of links.  If _cmp_proc_ is NULL or AQ_DEFCMP           */
/*  * then the default comparison procedure defcmplink() is used           */
/*  * sorting by host then filename. If cmp_proc is AQ_INVDATECMP           */
/*  * then invdatecmplink() is used sorting inverted by date.               */
/*  * otherwise a user-defined comparison procedure is called.               */
/*  *                                                                        */
/*  * archie_query returns NULL and sets perrno if the query                 */
/*  * failed. Note that it can return NULL with perrno == PSUCCESS           */
/*  * if the query didn‘t fail but there were simply no matches.             */
/*  *                                                                        */
/*  * query: S Substring search ignoring case                                */
/*  * C Substring search with case significant                               */
/*  * R Regular expression search                                            */
/*  * = Exact String Match                                                   */
/*  * sce Tries exact match first and falls back to S C or R             */
/*  * if not found.                                                          */
/*  *                                                                        */
/*  * cmp_proc: AQ_DEFCMP Sort by host then filename                        *

评论

共有 条评论