/*
    普通免流   例子，只需要修改HTTP/HTTPS代理IP跟模式(可作为wap模式)
*/


#######UDP部分########
httpUDP::udp {
    //如果搭建了cns服务器可以删除下面的注释(尽量搭建443端口)
    //udp_tproxy_listen = 0.0.0.0:6650;
    //destAddr = 101.71.140.5:8128;
    httpMod = tunnel;
    encrypt = 服务器密码;
    header_host = 服务器IP:服务器端口;
}


tcp::Global {
    tcp_listen = :::6650;
}

//HTTPS模式
httpMod::tunnel {
    del_line = host;
    set_first = "[M] [H] [V]\r\nHost: [H]\r\nProxy-Authorization: Basic dWMxMC43LjE2My4xNDQ6MWY0N2QzZWY1M2IwMzU0NDM0NTFjN2VlNzg3M2ZmMzg=\r\n";
}
//HTTP模式
httpMod::http {
    del_line = host;
    set_first = "[M] http://[H_P][U] [V]\r\nHost: [H_P]\r\nProxy-Authorization: Basic dWMxMC43LjE2My4xNDQ6MWY0N2QzZWY1M2IwMzU0NDM0NTFjN2VlNzg3M2ZmMzg=\r\n";
}

tcpProxy::http_proxy {
    //HTTP代理地址
    destAddr = 101.71.140.5:8128;
    httpMod = http;
}
tcpProxy::https_proxy {
    //HTTPS代理地址
    destAddr = 101.71.140.5:8128;
    tunnelHttpMod = tunnel;
    tunnel_proxy = on;
}
tcpProxy::denyNetwork {
    destAddr = deny_network;
}

//ssl端口先建立CONNECT连接
tcpAcl::firstConnect {
    tcpProxy = https_proxy;
    matchMode = firstMatch;

    dst_port = 443;
}
//匹配普通http请求
tcpAcl::http {
    tcpProxy = http_proxy;
    method != IS_NOT_HTTP|CONNECT;
}
tcpAcl::stream {
    tcpProxy = denyNetwork;
    dst_port != 0;
}


dns::Global {
    dns_listen = :::6653;
    cachePath = /dev/null;
}
dnsAcl {
    httpMod = http;
    //HTTP代理地址
    destAddr = 101.71.140.5:8128;
    header_host = 119.29.29.29;
    //只解析A记录(IPV4)和AAAA记录(IPV6)
    query_type = A;
    query_type = AAAA;
}
dnsAcl {
    //HTTP tunnel代理地址
    destAddr = 101.71.140.5:8128;
    //UC的tunnel只支持443端口，所以这里使用服务器的tls443解析
    header_host = 39.106.194.18:443;
    //先开启CONNECT代理再通过tls加密数据
    tunnel_proxy = on;
    tunnelHttpMod = tunnel;
    tls_client = on;
    lookup_mode = tcpDNS;
}

