From 09d667c49383edb980bcac88de1173c452066128 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 26 Jul 2020 16:45:11 -0700 Subject: fixes #844 WebSocket wildcard host errors fixes #1224 wss fails on IPV6 address This fixes bugs and inconsistencies in the way addresses are handled for HTTP (and consequently websocket). The Host: address line needs to look at numeric IPs and treat wildcards as if they are not specified, and needs to understand the IPv6 address format using brackets (e.g. [::1]:80). --- src/core/platform.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core') diff --git a/src/core/platform.h b/src/core/platform.h index 70420061..c6f4ef30 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -339,6 +339,12 @@ extern void nni_tcp_resolv(const char *, const char *, int, int, nni_aio *); // service names using UDP. extern void nni_udp_resolv(const char *, const char *, int, int, nni_aio *); +// nni_parse_ip parses an IP address, without a port. +extern int nni_parse_ip(const char *, nng_sockaddr *); + +// nni_parse_ip_port parses an IP address with an optional port appended. +extern int nni_parse_ip_port(const char *, nng_sockaddr *); + // // IPC (UNIX Domain Sockets & Named Pipes) Support. // -- cgit v1.2.3-70-g09d2