1. SOCKS 5协议简析

    简介

    要上google就是要翻墙,最基本的就是要用到代理协议,其中一个就是SOCKS 5代理协议。SOCKS 5是一种网络传输协议,SOCKS协议位于传输层(TCP/UDP等)与应用层之间,所以能代理TCP和UDP的网络流量,对于它之下的网络流量,就无能为力了。

    SOCKS是怎么工作的呢,这里举个例子:

    A想访问B站点,但是A和B站点之间有一个防火墙阻止A直接访问B站点,在A的网络里面有一个SOCKS代理C,C可以直接访问B站点,所以A通知C他想访问B站点,C就为A和B之间架起一条沟通的通道。

    协议

    协商

    客户端首先向SOCKS服务器自己的协议版本号,以及支持的认证方法。SOCKS服务器向客户端返回协议版本号以及选定的认证方法。

    认证

    客户端根据服务器端选定的方法进行认证,如果选定的方法是02,则根据RFC 1929定义的方法进行认证。RFC 1929定义的密码是明文传输,安全性较差。

    请求

    一旦指定认证方法的协商过程完成, 客户端发送详细的请求信息。经常使用 SOCKS 代理服务器的同志们会发现一种现象,即使 SOCKS 代理服务器设置正确,某些网站仍然无法访问,一般来说就是DNS污染造成的。SOCKS 5是通过将域名直接提交给 SOCKS 服务器来进行远端 ...

    read more

    comments

  2. Two Sum

    题目描述:

    原题链接

    Given an array of integers, find two numbers such that they add up to a specific target number.

    The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned ...

    read more

    comments

  3. 使用autotools生成Makefile学习笔记

    autotools使用流程

    autotools 是一系列工具,它包含了aclocal,autoconf,autoheader和automake这些工具,使用autotools主要就是利用各个工具来生成最后的makefile文件。其具体流程如下图:

    image

    如果你的系统安装了autoreconf,则上面的工具调用可以通过autoreconf这一个命令来完成,如果有哪个源文件更新,autoreconf会检测到并重新调用上面的工具来生成新的Makefile. 命令如下:

    autoreconf --install --force
    

    基础例子

    文件结构

    geesun@geesun-OptiPlex-3010:~/automake$ tree 
    .
    ├── configure.ac
    ├── Makefile.am
    └── src
        └── helloworld.c
    

    helloworld.c代码源文件:

    #include <config.h>
    #include <stdio.h>
    
    int main (void)
    {
        printf("Hello "PACKAGE_STRING);
        return 0;
    }
    

    configure.ac文件

    AC_INIT ...
    read more

    comments

« Page 2 / 2

个人链接