clnc配置脚本

 /*
    配合服务器cns配置,从tun读取数据 
    如果是用hcaas容器搭建的cns,那么只需要更改映射端口,免流host,密码和Head,也就是脚本中的Liucheng,就可以食用了。脚本没问题,不能用自己解决。
*/

Tun {
    tunAddr4 = 10.0.0.1;
    tunAddr6 = fc00::1;
    tunMtu = 1500;
    tunDevice = tunDev;
}

tcp::Global {
    timeout = 60;
}

httpMod::clns_https_request {
    del_line = host;

    //伪装成CONNECT
    set_first = "[M] wap.sc.189.cn [V]\r\nHost: wap.sc.189.cn\r\nLiucheng: [H]\r\n";

    //伪装成POST
    //set_first = "POST http://wap.sc.189.cn/ [V]\r\nHost: wap.sc.189.cn\r\nLiucheng: [H]\r\n";

    //伪装成WS
    //set_first = "GET /ws HTTP/1.1\r\nLiucheng: [H]\r\nHost: wap.sc.189.cn\r\nConnection: Upgrade\r\nSec-WebSocket-Key: Cute Linux Network\r\nSec-WebSocket-Version: 13\r\nUpgrade: websocket\r\nOrigin: http://wap.sc.189.cn/\r\n";
}

tcpProxy::https_proxy {
    destAddr = 121.52.226.190:37555;
    tunnel_encrypt = wangwanyi;
    tunnel_proxy = on;
    tunnelHttpMod = clns_https_request;
}

tcpAcl::firstConnect {
    tcpProxy = https_proxy;
    matchMode = firstMatch;
    timeout = -1;

    dst_port != 0;
}

dns::Global {
    cacheLimit = 512;
    cachePath = /dev/null;
}
dnsAcl {
    destaddr = 121.52.226.190:37555;
    header_host = 8.8.8.8:53;
    tunnelHttpMod = clns_https_request;
    tunnel_encrypt = wangwanyi;
    lookup_mode = tcpDNS;
}

httpUDP::udp {
    destAddr = 121.52.226.190:37555;
    encrypt = wangwanyi;
    header_host = wap.sc.189.cn;
    httpMod = clns_https_request;
}