-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add mekya stereotype config * Add mekya stereotype config: autogenerated * add autogenerated files * add mekya stereotype * add mekya stereotype: fixup * add mekya stereotype to default distro * add mekya testing
- Loading branch information
1 parent
5ffbc02
commit 05345cc
Showing
8 changed files
with
586 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"log": { | ||
"error": { | ||
"level": "Debug", | ||
"type": "Console" | ||
}, | ||
"access": { | ||
"type": "None" | ||
} | ||
}, | ||
"outbounds": [ | ||
{ | ||
"protocol": "vmess", | ||
"settings": { | ||
"address": "127.0.0.1", | ||
"port": 17773, | ||
"uuid": "bcc71618-e552-42c2-a2a3-d4c17a9df764" | ||
}, | ||
"streamSettings": { | ||
"transport": "mekya", | ||
"transportSettings": { | ||
"url": "https://127.0.0.1:17773/mrss48bvxrkfq1qzeqte5o61mmvc9gx6hq51", | ||
"maxWriteDelay": 80, | ||
"maxRequestSize": 96000, | ||
"pollingIntervalInitial": 200, | ||
"h2_pool_size": 8, | ||
"kcp": { | ||
"mtu": { | ||
"value": 1450 | ||
}, | ||
"tti": { | ||
"value": 15 | ||
}, | ||
"uplink_capacity": { | ||
"value": 40 | ||
}, | ||
"downlink_capacity": { | ||
"value": 2000 | ||
}, | ||
"congestion": false, | ||
"write_buffer": { | ||
"size": 671088640 | ||
}, | ||
"read_buffer": { | ||
"size": 671088640 | ||
} | ||
} | ||
}, | ||
"security": "tls", | ||
"securitySettings": { | ||
"pinnedPeerCertificateChainSha256": [ | ||
"kqHyvea27Pn+JiSqA72lhu9IKAKeGR+3yCyA8JR1mug=" | ||
], | ||
"allowInsecureIfPinnedPeerCertificate": true | ||
} | ||
} | ||
} | ||
], | ||
"inbounds": [ | ||
{ | ||
"protocol": "socks", | ||
"settings": { | ||
"udpEnabled": false, | ||
"address": "127.0.0.1", | ||
"packetEncoding": "Packet" | ||
}, | ||
"port": 17774, | ||
"listen": "127.0.0.1" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"log": { | ||
"error": { | ||
"level": "Debug", | ||
"type": "Console" | ||
}, | ||
"access": { | ||
"type": "None" | ||
} | ||
}, | ||
"outbounds": [ | ||
{ | ||
"protocol": "freedom" | ||
} | ||
], | ||
"inbounds": [ | ||
{ | ||
"listen": "127.0.0.1", | ||
"port": 17773, | ||
"protocol": "vmess", | ||
"settings": { | ||
"users": [ | ||
"bcc71618-e552-42c2-a2a3-d4c17a9df764" | ||
] | ||
}, | ||
"streamSettings": { | ||
"transport": "mekya", | ||
"transportSettings": { | ||
"url": "http://127.0.0.1:12777", | ||
"maxWriteSize": 10485760, | ||
"maxWriteDurationMs": 5000, | ||
"maxSimultaneousWriteConnection": 128, | ||
"packetWritingBuffer": 65536, | ||
"kcp": { | ||
"mtu": { | ||
"value": 1450 | ||
}, | ||
"tti": { | ||
"value": 15 | ||
}, | ||
"uplink_capacity": { | ||
"value": 40 | ||
}, | ||
"downlink_capacity": { | ||
"value": 2000 | ||
}, | ||
"congestion": false, | ||
"write_buffer": { | ||
"size": 671088640 | ||
}, | ||
"read_buffer": { | ||
"size": 671088640 | ||
} | ||
} | ||
}, | ||
"security": "tls", | ||
"securitySettings": { | ||
"certificate": [ | ||
{ | ||
"usage": "ENCIPHERMENT", | ||
"certificateFile": "cert/self-signed_cert.pem", | ||
"keyFile": "cert/self-signed_key.pem" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package scenarios | ||
|
||
import ( | ||
"context" | ||
"os" | ||
"testing" | ||
"time" | ||
|
||
"github.com/v2fly/v2ray-core/v5/common" | ||
"github.com/v2fly/v2ray-core/v5/testing/servers/tcp" | ||
|
||
_ "github.com/v2fly/v2ray-core/v5/main/distro/all" | ||
) | ||
|
||
func TestMekya(t *testing.T) { | ||
tcpServer := tcp.Server{ | ||
MsgProcessor: xor, | ||
} | ||
dest, err := tcpServer.Start() | ||
common.Must(err) | ||
defer tcpServer.Close() | ||
|
||
coreInst, InstMgrIfce := NewInstanceManagerCoreInstance() | ||
defer coreInst.Close() | ||
|
||
common.Must(InstMgrIfce.AddInstance( | ||
context.TODO(), | ||
"mekya_client", | ||
common.Must2(os.ReadFile("config/mekya_client.json")).([]byte), | ||
"jsonv5")) | ||
|
||
common.Must(InstMgrIfce.AddInstance( | ||
context.TODO(), | ||
"mekya_server", | ||
common.Must2(os.ReadFile("config/mekya_server.json")).([]byte), | ||
"jsonv5")) | ||
|
||
common.Must(InstMgrIfce.StartInstance(context.TODO(), "mekya_server")) | ||
common.Must(InstMgrIfce.StartInstance(context.TODO(), "mekya_client")) | ||
|
||
defer func() { | ||
common.Must(InstMgrIfce.StopInstance(context.TODO(), "mekya_server")) | ||
common.Must(InstMgrIfce.StopInstance(context.TODO(), "mekya_client")) | ||
common.Must(InstMgrIfce.UntrackInstance(context.TODO(), "mekya_server")) | ||
common.Must(InstMgrIfce.UntrackInstance(context.TODO(), "mekya_client")) | ||
coreInst.Close() | ||
}() | ||
|
||
if err := testTCPConnViaSocks(17774, dest.Port, 1024, time.Second*2)(); err != nil { | ||
t.Error(err) | ||
} | ||
} |
Oops, something went wrong.