diff --git a/server/socket_server.c b/server/socket_server.c index 7327a99..df13a72 100644 --- a/server/socket_server.c +++ b/server/socket_server.c @@ -28,7 +28,7 @@ static int build_addr_info(int port, struct addrinfo **info) { char *port_string = malloc((port_length + 1) * sizeof(char)); sprintf(port_string, "%d", port); - int addr_status = getaddrinfo(NULL, port_string, &hints, info); + int addr_status = getaddrinfo(LISTEN_ADDR, port_string, &hints, info); free(port_string); return addr_status; diff --git a/server/socket_server.h b/server/socket_server.h index 0241606..a29c941 100644 --- a/server/socket_server.h +++ b/server/socket_server.h @@ -3,6 +3,7 @@ #include "../common/socket_helper.h" +#define LISTEN_ADDR "::" #define BACKLOG_SIZE 8 #define HTTP_VERSION "HTTP/1.1" #define FILE_BUFFER_SIZE 1024