diff --git a/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc b/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc index 36c925a8e87..664cf0ef550 100644 --- a/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc +++ b/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc @@ -222,7 +222,7 @@ bool EvHTTPServer::StartAcceptingRequests() { // "::" => in6addr_any ev_uint16_t ev_port = static_cast(port); - ev_listener_ = evhttp_bind_socket_with_handle(ev_http_, "::", ev_port); + ev_listener_ = evhttp_bind_socket_with_handle(ev_http_, "127.0.0.1", ev_port); if (ev_listener_ == nullptr) { // in case ipv6 is not supported, fallback to inaddr_any ev_listener_ = evhttp_bind_socket_with_handle(ev_http_, nullptr, ev_port); diff --git a/tensorflow_serving/util/net_http/socket/testing/ev_print_req_server.cc b/tensorflow_serving/util/net_http/socket/testing/ev_print_req_server.cc index c17bc2a1efa..f5b39134508 100644 --- a/tensorflow_serving/util/net_http/socket/testing/ev_print_req_server.cc +++ b/tensorflow_serving/util/net_http/socket/testing/ev_print_req_server.cc @@ -193,7 +193,7 @@ int main(int argc, char **argv) { // nullptr will bind to ipv4, which will fail to accept // requests from clients where getaddressinfo() defaults to AF_INET6 - handle = evhttp_bind_socket_with_handle(http, "::0", (ev_uint16_t)port); + handle = evhttp_bind_socket_with_handle(http, "127.0.0.1", (ev_uint16_t)port); if (!handle) { fprintf(stderr, "couldn't bind to port %d. Exiting.\n", (int)port); return 1;