feat: improve warp, outbounds reputation
This commit is contained in:
18 files changed
+533
-224
No files matched your search
@@ -18,7 +18,7 @@ Endpoint = engage.cloudflareclient.com:2408
|
||||
|
||||
class WarpOutboundTest(unittest.TestCase):
|
||||
def test_sing_box_endpoint(self):
|
||||
ob = build(WGCF, "sing-box", "warp", 255)
|
||||
ob = build(WGCF, "warp", 255)
|
||||
self.assertEqual(ob["type"], "wireguard")
|
||||
self.assertEqual(ob["address"], ["172.16.0.2/32", "2606:4700:110:8d58::2/128"])
|
||||
self.assertEqual(ob["private_key"], "priv=")
|
||||
@@ -28,20 +28,14 @@ class WarpOutboundTest(unittest.TestCase):
|
||||
[{"address": "engage.cloudflareclient.com", "port": 2408, "public_key": "pub=", "allowed_ips": ["0.0.0.0/0", "::/0"]}],
|
||||
)
|
||||
|
||||
def test_xray_outbound(self):
|
||||
ob = build(WGCF, "xray", "warp", None)
|
||||
self.assertEqual(ob["protocol"], "wireguard")
|
||||
self.assertEqual(ob["settings"]["secretKey"], "priv=")
|
||||
self.assertEqual(ob["settings"]["peers"][0]["endpoint"], "engage.cloudflareclient.com:2408")
|
||||
self.assertNotIn("streamSettings", ob)
|
||||
|
||||
def test_ipv6_endpoint(self):
|
||||
ob = build(WGCF.replace("engage.cloudflareclient.com:2408", "[2606:4700:d0::a29f:c001]:500"), "sing-box", "warp", None)
|
||||
ob = build(WGCF.replace("engage.cloudflareclient.com:2408", "[2606:4700:d0::a29f:c001]:500"), "warp", None)
|
||||
self.assertEqual((ob["peers"][0]["address"], ob["peers"][0]["port"]), ("2606:4700:d0::a29f:c001", 500))
|
||||
self.assertNotIn("routing_mark", ob)
|
||||
|
||||
def test_rejects_missing_peer(self):
|
||||
with self.assertRaises(ConfigError):
|
||||
build(WGCF.split("[Peer]")[0], "sing-box", "warp", None)
|
||||
build(WGCF.split("[Peer]")[0], "warp", None)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user