ed557

学习笔记

2022年11月15日 #

各语言获取当前时间 和 时间字符串时间戳转换

摘要: . 阅读全文

posted @ 2022-11-15 23:00 ed557 阅读(5) 评论(0) 推荐(0) 编辑

libcurl 发送HTTP请求时获取目标IP

摘要: #include "curl/curl.h" int main() { char* ip; CURL* curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, "https://baidu.com"); CURLcode res = 阅读全文

posted @ 2022-11-15 22:55 ed557 阅读(130) 评论(0) 推荐(0) 编辑

golang发送HTTP请求时获取目标IP (server ip)

摘要: golang net/http库在发送http请求时会通过调用net下的Dialer建立TCP连接, net.Dialer 会在发起连接前执行通过ControlContext字段传入的一个函数, 我们可以通过这个函数获取ip、端口和网络名等信息。 https://cs.opensource.goog 阅读全文

posted @ 2022-11-15 21:24 ed557 阅读(609) 评论(0) 推荐(0) 编辑

导航