示例#1
0
def test_ssudp():
    server, bind_addr, _ = get_server("ssudp://*****:*****@127.0.0.1:0")
    address = f"{bind_addr[0]}:{bind_addr[1]}"
    server2, bind_addr2, _ = get_server(
        f"tunneludp://127.0.0.1:0/?target=1.1.1.1:53&via=ssudp://chacha20:1@{address}"
    )
    curio.run(main(bind_addr2, server, server2))
def test_http_via():
    via_server, bind_addr, _ = get_server("http://:0")
    via_address = f"{bind_addr[0]}:{bind_addr[1]}"
    server, bind_addr, _ = get_server(
        f"http://127.0.0.1:0/?via=http://{via_address}")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"http://{bind_address}")
    curio.run(main(make_request(client), server, via_server))
def test_via():
    via_server, bind_addr, _ = get_server("ss://*****:*****@127.0.0.1:0")
    via_address = f"{bind_addr[0]}:{bind_addr[1]}"
    server, bind_addr, _ = get_server(
        f"socks://127.0.0.1:0/?via=ss://chacha20:1@{via_address}")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"socks://{bind_address}")
    curio.run(main(make_request(client), server, via_server))
def test_ss_http_simple():
    server, bind_addr, _ = get_server(
        "ss://*****:*****@127.0.0.1:0/?plugin=http_simple")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(
        f"ss://*****:*****@{bind_address}/?plugin=http_simple")
    curio.run(main(make_request(client), server))
示例#5
0
def test_tunneludp():
    server, bind_addr, _ = get_server("tunneludp://127.0.0.1:0?target=1.1.1.1:53")
    curio.run(main(bind_addr, server))
def test_transparent():
    server, bind_addr, _ = get_server("red://0.0.0.0:12345")
    curio.run(main(job, server))
def test_aead():
    server, bind_addr, _ = get_server("ss://*****:*****@127.0.0.1:0")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"ss://*****:*****@{bind_address}")
    curio.run(main(make_request(client), server))
def test_ss_over_tls():
    server, bind_addr, _ = get_server(
        "ss://*****:*****@127.0.0.1:0/?plugin=tls1.2")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"ss://*****:*****@{bind_address}/?plugin=tls1.2")
    curio.run(main(make_request(client), server))
def test_socks5_with_auth():
    server, bind_addr, _ = get_server("socks://*****:*****@127.0.0.1:0")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"socks://*****:*****@{bind_address}")
    curio.run(main(make_request(client), server))
def test_socks4():
    server, bind_addr, _ = get_server("socks4://127.0.0.1:0")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"socks4://{bind_address}")
    curio.run(main(make_request(client), server))
def test_http_only():
    server, bind_addr, _ = get_server("http://*****:*****@127.0.0.1:0")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"httponly://*****:*****@{bind_address}")
    url = "http://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"
    curio.run(main(make_request(client, url), server))
示例#12
0
def test_cli():
    with pytest.raises(argparse.ArgumentTypeError):
        get_server("ss://")