Fix: Client config uses fixed port 9002, add protective comments
- Changed client server port from 0 (unsupported) to 9002 (fixed) - Added comments explaining importance of fixed ports vs random ports - ETCP now uses proper port configuration for client-server setup
This commit is contained in:
1 parent
03a409232c
commit
c026cdec88
1 file changed
+7
-2
@@ -70,8 +70,10 @@ int main() {
|
||||
fclose(f);
|
||||
|
||||
// Create client config
|
||||
// ВАЖНО: Использовать фиксированный порт, случайные порты (0) не поддерживаются
|
||||
// Клиентский сервер должен использовать другой порт, чем удаленный сервер
|
||||
f = fopen("/tmp/c.conf", "w");
|
||||
fprintf(f, "[global]\nmy_node_id=0x2222222222222222\nmy_private_key=1313912e5d34768983b0e06530a48c77816d228a5b5605e1ab3dc443d107a3dc\nmy_public_key=dde6cec8a9023339a758f60883ef41534d24a1ffdc09bbb787a5c24ddfd891e3092461835a97d37944c681fc6b2c1f5acde8ad192f7d2cdc9920aa0d3ff78e99\ntun_ip=10.99.0.2/24\ntun_ifname=tun98\n\n[server:local]\naddr=0.0.0.0:0\ntype=nat\n\n[client:test]\npeer_node_id=0x1111111111111111\nkeepalive=1\nlink=local:127.0.0.1:9001\n");
|
||||
fprintf(f, "[global]\nmy_node_id=0x2222222222222222\nmy_private_key=1313912e5d34768983b0e06530a48c77816d228a5b5605e1ab3dc443d107a3dc\nmy_public_key=dde6cec8a9023339a758f60883ef41534d24a1ffdc09bbb787a5c24ddfd891e3092461835a97d37944c681fc6b2c1f5acde8ad192f7d2cdc9920aa0d3ff78e99\ntun_ip=10.99.0.2/24\ntun_ifname=tun98\n\n[server:local]\naddr=127.0.0.1:9002\ntype=nat\n\n[client:test]\npeer_node_id=0x1111111111111111\nkeepalive=1\nlink=local:127.0.0.1:9001\n");
|
||||
fclose(f);
|
||||
|
||||
struct UASYNC* sua = uasync_create();
|
||||
@@ -88,6 +90,9 @@ int main() {
|
||||
init_connections(client_instance);
|
||||
|
||||
printf("✓ Both instances initialized\n");
|
||||
printf("✓ Server listening on 127.0.0.1:9001\n");
|
||||
printf("✓ Client local server on 127.0.0.1:9002\n");
|
||||
printf("✓ Client connecting to server at 127.0.0.1:9001\n");
|
||||
|
||||
uasync_set_timeout(sua, 1000, NULL, monitor_connections);
|
||||
|
||||
@@ -105,4 +110,4 @@ int main() {
|
||||
unlink("/tmp/c.conf");
|
||||
|
||||
return test_completed ? 0 : 1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user