2019-04-01 02:14:42 +02:00
|
|
|
diff --git a/thirdparty/libwebsockets/plat/lws-plat-unix.c b/thirdparty/libwebsockets/plat/lws-plat-unix.c
|
|
|
|
index 7dba3bd82..d1bca8b5d 100644
|
|
|
|
--- a/thirdparty/libwebsockets/plat/lws-plat-unix.c
|
|
|
|
+++ b/thirdparty/libwebsockets/plat/lws-plat-unix.c
|
|
|
|
@@ -328,6 +328,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd)
|
2019-03-06 06:29:19 +01:00
|
|
|
int optval = 1;
|
|
|
|
socklen_t optlen = sizeof(optval);
|
|
|
|
|
|
|
|
+#ifdef LWS_WITH_IPV6
|
|
|
|
+ optval = 0;
|
|
|
|
+ setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if defined(__APPLE__) || \
|
|
|
|
defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
|
|
|
|
defined(__NetBSD__) || \
|
2019-04-01 02:14:42 +02:00
|
|
|
diff --git a/thirdparty/libwebsockets/plat/lws-plat-win.c b/thirdparty/libwebsockets/plat/lws-plat-win.c
|
|
|
|
index 1850b6425..26caab2cd 100644
|
|
|
|
--- a/thirdparty/libwebsockets/plat/lws-plat-win.c
|
|
|
|
+++ b/thirdparty/libwebsockets/plat/lws-plat-win.c
|
|
|
|
@@ -348,6 +348,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd)
|
2019-03-06 06:29:19 +01:00
|
|
|
struct protoent *tcp_proto;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef LWS_WITH_IPV6
|
|
|
|
+ optval = 0;
|
|
|
|
+ setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
if (vhost->ka_time) {
|
|
|
|
/* enable keepalive on this socket */
|
|
|
|
optval = 1;
|