Example #1
0
def configure(args):
    args += ['--google-host', 'goagent-google-ip.fqrouter.com']
    if config.read().get('youtube_scrambler_enabled', True):
        args += ['--enable-youtube-scrambler']
    if config.read().get('goagent_public_servers_enabled', True):
        args += ['--proxy', 'dynamic,n=10,type=goagent,dns_record=goagent#n#.fqrouter.com,priority=1']
    for server in config.list_goagent_private_servers():
        proxy_config = 'goagent,appid=%s,path=%s,password=%s' % (server['appid'], server['path'], server['password'])
        args += ['--proxy', proxy_config]
    if config.read().get('shadowsocks_public_servers_enabled', True):
        args += ['--proxy', 'dynamic,n=4,type=ss,dns_record=ss#n#.fqrouter.com,priority=3']
    for server in config.list_shadowsocks_private_servers():
        proxy_config = 'ss,proxy_ip=%s,proxy_port=%s,password=%s,encrypt_method=%s' % (
            server['host'], server['port'], server['password'], server['encryption_method'])
        args += ['--proxy', proxy_config]
    if config.read().get('http_proxy_public_servers_enabled', True):
        args += ['--proxy', 'dynamic,n=20,dns_record=proxy#n#.fqrouter.com,is_public=True,priority=4']
        args += ['--proxy', 'dynamic,n=5,dns_record=proxy2#n#.fqrouter.com,priority=2']
    for server in config.list_http_proxy_private_servers():
        is_secured = 'True' if 'ssl' == server['transport_type'] else 'False'
        proxy_config = 'proxy_ip=%s,proxy_port=%s,username=%s,password=%s,is_secured=%s' % \
                       (server['host'], server['port'], server['username'], server['password'], is_secured)
        if 'http only' == server['traffic_type']:
            args += ['--proxy', 'http-relay,%s' % proxy_config]
        elif 'https only' == server['traffic_type']:
            args += ['--proxy', 'http-connect,%s' % proxy_config]
        else:
            args += ['--proxy', 'http-relay,%s' % proxy_config]
            args += ['--proxy', 'http-connect,%s' % proxy_config]
    for server in config.list_ssh_private_servers():
        proxy_config = 'proxy_ip=%s,proxy_port=%s,username=%s,password=%s' % \
                       (server['host'], server['port'], server['username'], server['password'])
        for i in range(server['connections_count']):
            args += ['--proxy', 'ssh,%s' % proxy_config]
    return args
Example #2
0
def configure(args):
    args += ['--google-host', 'goagent-google-ip.fqrouter.com']
    args += ['--google-host', 'goagent-google-ip2.fqrouter.com']
    if not config.read().get('auto_access_check_enabled', True):
        args += ['--disable-access-check']
    if not config.read().get('china_shortcut_enabled', True):
        args += ['--disable-china-shortcut']
    if not config.read().get('direct_access_enabled', True):
        args += ['--disable-direct-access']
    if config.read().get('youtube_scrambler_enabled', True):
        args += ['--enable-youtube-scrambler']
    public_server_types = []
    if config.read().get('goagent_public_servers_enabled', True):
        public_server_types.append('goagent')
    if config.read().get('shadowsocks_public_servers_enabled', True):
        public_server_types.append('ss')
    if config.read().get('http_proxy_public_servers_enabled', True):
        public_server_types.append('http-connect')
        public_server_types.append('http-relay')
        public_server_types.append('spdy-connect')
        public_server_types.append('spdy-relay')
    if public_server_types:
        args += ['--proxy', 'directory,src=proxies.fqrouter.com,%s' % ','.join(['%s=True' % t for t in public_server_types])]
    for server in config.list_goagent_private_servers():
        proxy_config = 'goagent,appid=%s,path=%s,password=%s' % (server['appid'], server['path'], server['password'])
        args += ['--proxy', proxy_config]
    for server in config.list_shadowsocks_private_servers():
        proxy_config = 'ss,proxy_host=%s,proxy_port=%s,password=%s,encrypt_method=%s' % (
            server['host'], server['port'], server['password'], server['encryption_method'])
        args += ['--proxy', proxy_config]
    for server in config.list_http_proxy_private_servers():
        if 'spdy (webvpn)' == server['transport_type']:
            proxy_config = 'proxy_host=%s,proxy_port=%s,username=%s,password=%s,requested_spdy_version=%s' % \
                           (server['host'], server['port'], server['username'], server['password'],
                            server['spdy_version'])
            for i in range(server['spdy_connections_count']):
                if 'http only' == server['traffic_type']:
                    args += ['--proxy', 'spdy-relay,%s' % proxy_config]
                elif 'https only' == server['traffic_type']:
                    args += ['--proxy', 'spdy-connect,%s' % proxy_config]
                else:
                    args += ['--proxy', 'spdy-relay,%s' % proxy_config]
                    args += ['--proxy', 'spdy-connect,%s' % proxy_config]
        else:
            is_secured = 'True' if 'ssl' == server['transport_type'] else 'False'
            proxy_config = 'proxy_host=%s,proxy_port=%s,username=%s,password=%s,is_secured=%s' % \
                           (server['host'], server['port'], server['username'], server['password'], is_secured)
            if 'http only' == server['traffic_type']:
                args += ['--proxy', 'http-relay,%s' % proxy_config]
            elif 'https only' == server['traffic_type']:
                args += ['--proxy', 'http-connect,%s' % proxy_config]
            else:
                args += ['--proxy', 'http-relay,%s' % proxy_config]
                args += ['--proxy', 'http-connect,%s' % proxy_config]
    for server in config.list_ssh_private_servers():
        proxy_config = 'proxy_host=%s,proxy_port=%s,username=%s,password=%s' % \
                       (server['host'], server['port'], server['username'], server['password'])
        for i in range(server['connections_count']):
            args += ['--proxy', 'ssh,%s' % proxy_config]
    return args
Example #3
0
def configure(args):
    args += ['--google-host', 'goagent-google-ip.fqrouter.com']
    if config.read().get('full_google_play_enabled', True):
        args += ['--black-ip', 'android.clients.google.com']
    if not config.read().get('auto_access_check_enabled', True):
        args += ['--disable-access-check']
    if not config.read().get('china_shortcut_enabled', True):
        args += ['--disable-china-shortcut']
    if not config.read().get('direct_access_enabled', True):
        args += ['--disable-direct-access']
    if config.read().get('youtube_scrambler_enabled', True):
        args += ['--enable-youtube-scrambler']
    if config.read().get('goagent_public_servers_enabled', True):
        args += ['--proxy', 'dynamic,n=10,type=goagent,dns_record=goagent#n#.fqrouter.com,priority=1']
    for server in config.list_goagent_private_servers():
        proxy_config = 'goagent,appid=%s,path=%s,password=%s' % (server['appid'], server['path'], server['password'])
        args += ['--proxy', proxy_config]
    if config.read().get('shadowsocks_public_servers_enabled', True):
        args += ['--proxy', 'dynamic,n=7,type=ss,dns_record=ss#n#.fqrouter.com,priority=2']
    for server in config.list_shadowsocks_private_servers():
        proxy_config = 'ss,proxy_ip=%s,proxy_port=%s,password=%s,encrypt_method=%s' % (
            server['host'], server['port'], server['password'], server['encryption_method'])
        args += ['--proxy', proxy_config]
    if config.read().get('http_proxy_public_servers_enabled', True):
        args += ['--proxy', 'dynamic,n=20,dns_record=proxy#n#.fqrouter.com,is_public=True,priority=4']
        args += ['--proxy', 'dynamic,n=5,dns_record=proxy2#n#.fqrouter.com,priority=2']
    for server in config.list_http_proxy_private_servers():
        if 'spdy (webvpn)' == server['transport_type']:
            proxy_config = 'proxy_ip=%s,proxy_port=%s,username=%s,password=%s,requested_spdy_version=%s' % \
                           (server['host'], server['port'], server['username'], server['password'],
                            server['spdy_version'])
            for i in range(server['spdy_connections_count']):
                if 'http only' == server['traffic_type']:
                    args += ['--proxy', 'spdy-relay,%s' % proxy_config]
                elif 'https only' == server['traffic_type']:
                    args += ['--proxy', 'spdy-connect,%s' % proxy_config]
                else:
                    args += ['--proxy', 'spdy-relay,%s' % proxy_config]
                    args += ['--proxy', 'spdy-connect,%s' % proxy_config]
        else:
            is_secured = 'True' if 'ssl' == server['transport_type'] else 'False'
            proxy_config = 'proxy_ip=%s,proxy_port=%s,username=%s,password=%s,is_secured=%s' % \
                           (server['host'], server['port'], server['username'], server['password'], is_secured)
            if 'http only' == server['traffic_type']:
                args += ['--proxy', 'http-relay,%s' % proxy_config]
            elif 'https only' == server['traffic_type']:
                args += ['--proxy', 'http-connect,%s' % proxy_config]
            else:
                args += ['--proxy', 'http-relay,%s' % proxy_config]
                args += ['--proxy', 'http-connect,%s' % proxy_config]
    for server in config.list_ssh_private_servers():
        proxy_config = 'proxy_ip=%s,proxy_port=%s,username=%s,password=%s' % \
                       (server['host'], server['port'], server['username'], server['password'])
        for i in range(server['connections_count']):
            args += ['--proxy', 'ssh,%s' % proxy_config]
    return args
Example #4
0
def configure(args):
    args += ["--google-host", "goagent-google-ip.fqrouter.com"]
    if config.read().get("full_google_play_enabled", True):
        args += ["--black-ip", "android.clients.google.com"]
    if not config.read().get("auto_access_check_enabled", True):
        args += ["--disable-access-check"]
    if not config.read().get("china_shortcut_enabled", True):
        args += ["--disable-china-shortcut"]
    if not config.read().get("direct_access_enabled", True):
        args += ["--disable-direct-access"]
    if config.read().get("youtube_scrambler_enabled", True):
        args += ["--enable-youtube-scrambler"]
    if config.read().get("goagent_public_servers_enabled", True):
        args += ["--proxy", "dynamic,n=10,type=goagent,dns_record=goagent#n#.fqrouter.com,priority=1"]
    for server in config.list_goagent_private_servers():
        proxy_config = "goagent,appid=%s,path=%s,password=%s" % (server["appid"], server["path"], server["password"])
        args += ["--proxy", proxy_config]
    if config.read().get("shadowsocks_public_servers_enabled", True):
        args += ["--proxy", "dynamic,n=7,type=ss,dns_record=ss#n#.fqrouter.com,priority=2"]
    for server in config.list_shadowsocks_private_servers():
        proxy_config = "ss,proxy_host=%s,proxy_port=%s,password=%s,encrypt_method=%s" % (
            server["host"],
            server["port"],
            server["password"],
            server["encryption_method"],
        )
        args += ["--proxy", proxy_config]
    if config.read().get("http_proxy_public_servers_enabled", True):
        args += ["--proxy", "dynamic,n=20,dns_record=proxy#n#.fqrouter.com,is_public=True,priority=4"]
        args += ["--proxy", "dynamic,n=5,dns_record=proxy2#n#.fqrouter.com,priority=2"]
    for server in config.list_http_proxy_private_servers():
        if "spdy (webvpn)" == server["transport_type"]:
            proxy_config = "proxy_host=%s,proxy_port=%s,username=%s,password=%s,requested_spdy_version=%s" % (
                server["host"],
                server["port"],
                server["username"],
                server["password"],
                server["spdy_version"],
            )
            for i in range(server["spdy_connections_count"]):
                if "http only" == server["traffic_type"]:
                    args += ["--proxy", "spdy-relay,%s" % proxy_config]
                elif "https only" == server["traffic_type"]:
                    args += ["--proxy", "spdy-connect,%s" % proxy_config]
                else:
                    args += ["--proxy", "spdy-relay,%s" % proxy_config]
                    args += ["--proxy", "spdy-connect,%s" % proxy_config]
        else:
            is_secured = "True" if "ssl" == server["transport_type"] else "False"
            proxy_config = "proxy_host=%s,proxy_port=%s,username=%s,password=%s,is_secured=%s" % (
                server["host"],
                server["port"],
                server["username"],
                server["password"],
                is_secured,
            )
            if "http only" == server["traffic_type"]:
                args += ["--proxy", "http-relay,%s" % proxy_config]
            elif "https only" == server["traffic_type"]:
                args += ["--proxy", "http-connect,%s" % proxy_config]
            else:
                args += ["--proxy", "http-relay,%s" % proxy_config]
                args += ["--proxy", "http-connect,%s" % proxy_config]
    for server in config.list_ssh_private_servers():
        proxy_config = "proxy_host=%s,proxy_port=%s,username=%s,password=%s" % (
            server["host"],
            server["port"],
            server["username"],
            server["password"],
        )
        for i in range(server["connections_count"]):
            args += ["--proxy", "ssh,%s" % proxy_config]
    return args