From 71bb40080510bd1d2ddf90e0b81bd69f0bbb4dd9 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 26 Jan 2017 07:27:11 +0800 Subject: [PATCH] http_proxy: deal with redundant protocol leader https://github.com/warmcat/libwebsockets/issues/764 --- lib/libwebsockets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index b0b05560d..4ac3d1d72 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1046,6 +1046,10 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy) if (!proxy) return -1; + /* we have to deal with a possible redundant leading http:// */ + if (!strncmp(proxy, "http://", 7)) + proxy += 7; + p = strchr(proxy, '@'); if (p) { /* auth is around */