diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 8165322..e89897a 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -2763,7 +2763,7 @@ void MeshServer_ConnectEx(MeshAgentHostContainer *agent) { printf("Disabling Proxy: %s\n", ILibScratchPad); agent->triedNoProxy_Index++; - agent->proxyServer = NULL; + agent->proxyServer = ILibWebClient_SetProxy(reqToken, NULL, 0, NULL, NULL);; if (duk_peval_string(agent->meshCoreCtx, "require('global-tunnel');") == 0) { diff --git a/microstack/ILibAsyncSocket.c b/microstack/ILibAsyncSocket.c index 6e08366..003257d 100644 --- a/microstack/ILibAsyncSocket.c +++ b/microstack/ILibAsyncSocket.c @@ -1010,6 +1010,7 @@ void ILibAsyncSocket_ClearProxySettings(void *socketModule) { struct ILibAsyncSocketModule *module = (struct ILibAsyncSocketModule*)socketModule; memset(&(module->ProxyAddress), 0, sizeof(struct sockaddr_in6)); + module->ProxyState = 0; } //! Connect using an HTTPS proxy. If "proxyAddress" is set to NULL, this call acts just to a normal connect call without a proxy. diff --git a/microstack/ILibWebClient.c b/microstack/ILibWebClient.c index ed9663f..a73649e 100644 --- a/microstack/ILibWebClient.c +++ b/microstack/ILibWebClient.c @@ -3797,6 +3797,11 @@ struct sockaddr_in6* ILibWebClient_SetProxy(ILibWebClient_RequestToken token, ch { ILibWebClientDataObject *wcdo = ILibWebClient_GetStateObjectFromRequestToken(token); if (wcdo == NULL) { return(NULL); } + if (proxyHost == NULL) + { + memset(&(wcdo->proxy), 0, sizeof(struct sockaddr_in6)); + return(NULL); + } if (ILibResolveEx(proxyHost, proxyPort, &(wcdo->proxy)) != 0 || wcdo->proxy.sin6_family == AF_UNSPEC) {