SKCP is a library of encapsulation of KCP, it has the function of connection management and encryption.
"It's not that it can't be used", applied in SKCPTUN
Operating environment: Linux, MacOS
Dependent libraries: OpenSSL, libev
The client code needs to implement the following in skcp_conf_t:
void (*on_recv_cid)(skcp_t *skcp, uint32_t cid);
void (*on_recv_data)(skcp_t *skcp, uint32_t cid, char *buf, int len);
void (*on_close)(skcp_t *skcp, uint32_t cid);
The server code needs to implement the following in skcp_conf_t:
void (*on_accept)(skcp_t *skcp, uint32_t cid);
int (*on_check_ticket)(skcp_t *skcp, char *ticket, int len);
void (*on_recv_data)(skcp_t *skcp, uint32_t cid, char *buf, int len);
void (*on_close)(skcp_t *skcp, uint32_t cid);
Compile the test code:
cd skcp
mkdir build
make
Run the test server:
cd build
./skcp_server
Currently, the test server command can only serve one client, which is a point-to-point service. If more than one are needed, multiple skcp_server processes need to be started, like "netcat". Get help via the "-h" parameter. By default, it listens to port 6060 at the 127.0.0.1 address. You can specify the listening network interface and port as well as the encryption key through parameters:
./skcp_server -a 0.0.0.0 -p 8080 -k yourpassword
Run the test client:
cd build
./skcp_client
Get help via the "-h" parameter. By default, port 6060 of the 127.0.0.1 address is connected. You can specify the network interface and port to be connected and the encryption key through parameters:
./skcp_client -a 127.0.0.1 -p 8080 -k yourpassword