Created
May 10, 2012 19:10
-
-
Save sodabrew/2655193 to your computer and use it in GitHub Desktop.
libevent HTTP server client IP address
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
void http_request_cb(struct evhttp_request *req, void *user) | |
{ | |
char *client_ip; | |
u_short client_port; | |
evhttp_connection_get_peer(evhttp_request_get_connection(req), &client_ip, &client_port); | |
printf("Client IP [%s] port [%d]\n", client_ip, client_port); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment