我可以使用 curl 的函数来接收客户端 https 连接吗?我想使用 libcurl 编写服务器,我应该使用裸套接字来接受连接吗?官方文档提供了如下示例:
/* read the response */
for(;;)
{
char buf[1024];
wait_on_socket(sockfd, 1, 60000L);
res = curl_easy_recv(curl, buf, 1024, &iolen);
if(CURLE_OK != res)
break;
printf("Received %u bytes.\n", iolen);
}
但他们总是写客户端,而不是服务器...
最佳答案
libcurl is a free, open source client to get documents/files from servers, using any of the supported protocols.
它是一个客户端库,而不是 HTTPS 服务器。
关于c - 如何使用 libcurl 作为服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6226068/