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))
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_get_client(): ns = get_client("shadowproxy.proxies.socks.client.SocksClient://:0") assert "SocksClient" == ns.__class__.__name__
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))
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))
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))