Ejemplo n.º 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))
Ejemplo n.º 2
0
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))
Ejemplo n.º 3
0
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))
Ejemplo n.º 4
0
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))
Ejemplo n.º 5
0
def test_cli():
    with pytest.raises(argparse.ArgumentTypeError):
        get_server("ss://")
Ejemplo n.º 6
0
def test_transparent():
    server, bind_addr, _ = get_server("red://0.0.0.0:12345")
    curio.run(main(job, server))
Ejemplo n.º 7
0
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))
Ejemplo n.º 8
0
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))
Ejemplo n.º 9
0
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))
Ejemplo n.º 10
0
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))
Ejemplo n.º 11
0
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))
Ejemplo n.º 12
0
def test_tunneludp():
    server, bind_addr, _ = get_server(
        "tunneludp://127.0.0.1:0?target=1.1.1.1:53&source_ip=in")
    curio.run(main(bind_addr, server))
Ejemplo n.º 13
0
def test_http_forward():
    server, bind_addr, _ = get_server("http://*****:*****@127.0.0.1:0")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"forward://*****:*****@{bind_address}")
    curio.run(main(make_request(client, url_http), server))
Ejemplo n.º 14
0
def my_test_ipv6():
    server, bind_addr, _ = get_server("http://*****:*****@[::1]:0")
    bind_address = f"{bind_addr[0]}:{bind_addr[1]}"
    client = get_client(f"http://*****:*****@{bind_address}")
    curio.run(main(make_request(client), server))