Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple HTTP calls fail on the same connection #7

Closed
sveldhuisen opened this issue Apr 8, 2022 · 14 comments
Closed

Multiple HTTP calls fail on the same connection #7

sveldhuisen opened this issue Apr 8, 2022 · 14 comments
Assignees
Labels
bug Something isn't working status:fixed The issue has been fixed

Comments

@sveldhuisen
Copy link

sveldhuisen commented Apr 8, 2022

Thank you for this excellent piece of software. It is very helpful to authenticate my Java REST client to an IIS server requiring NTLM authentication.

Bug description
When putting multiple requests on the same HTTP connection my HTTP REST client ends up with an IOException. My HTTP REST client is using Apache HTTP Client as well, and using WinFoom as a Proxy Server to handle NTLM authentication to a IIS Web Server. Therefore I'm using the HTTP proxy mode:

{
"proxyType" : "HTTP",
"proxyHost" : "172.16.1.10",
"proxyPort" : 8020,
"proxyUsername" : "web-user",
"proxyPassword" : "*******",
"localPort" : 3129,
"proxyTestUrl" : "http://example.com",
"httpAuthProtocol" : "NTLM"
}

my HTTP REST client is also using a shared connection manager with a PoolingHttpClientConnectionManager. What I see is that the initial request is from my REST client is working fine, but the subsequent request on the same connection fails with an IOException. When doing the second request I noticed that WinFoom has already closed the socket, without informing the requester (my REST client)

I.e. Im doing a HTTP GET followed by a HTTP POST on the samen connection. When running WinFoom in debug mode I clearly see that he socket is already closed, after the first HTTP GET. I suspect that the socket is closed without informing my REST client, so therefore it assumes the HTTP connection is still open.

To Reproduce
Steps to reproduce the behaviour:

  1. Make subsequent HTTP calls on the same connection
  2. The first call succeeds, the second one fails

Log

08-04-2022 14:27:58.859 [pool-1-thread-2] DEBUG o.a.h.impl.execchain.MainClientExec.execute - Executing request GET http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID%20eq%2012570&$select=ID HTTP/1.1
08-04-2022 14:27:58.859 [pool-1-thread-2] DEBUG o.a.h.impl.execchain.MainClientExec.execute - Target auth state: HANDSHAKE
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG o.a.h.impl.execchain.MainClientExec.execute - Proxy auth state: UNCHALLENGED
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> GET http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID%20eq%2012570&$select=ID HTTP/1.1
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Accept: application/json
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> ServerName: sqldb.local.domain
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> DatabaseName: 123
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Cache-Control: no-store, no-cache
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Content-Type: application/json; charset=utf-8
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Host: iis-webserver.local.domain:8020
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Proxy-Connection: Keep-Alive
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> User-Agent: Apache-HttpClient/4.4.1 (Java/1.8.0_292)
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Accept-Encoding: gzip,deflate
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Via: 1.1 winfoom
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.headers.onRequestSubmitted - http-outgoing-24 >> Authorization: NTLM **********************
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "GET http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID%20eq%2012570&$select=ID HTTP/1.1[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Accept: application/json[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "ServerName: sqldb.local.domain[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "DatabaseName: 123[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Cache-Control: no-store, no-cache[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Content-Type: application/json; charset=utf-8[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Host: iis-webserver.local.domain:8020[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Proxy-Connection: Keep-Alive[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "User-Agent: Apache-HttpClient/4.4.1 (Java/1.8.0_292)[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Accept-Encoding: gzip,deflate[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Via: 1.1 winfoom[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "Authorization: NTLM **********************=[\r][\n]"
08-04-2022 14:27:58.860 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 >> "[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "HTTP/1.1 200 OK[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "Cache-Control: no-cache[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "Content-Length: 20[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "Content-Type: application/json;odata=verbose;charset=utf-8[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "Server: Microsoft-HTTPAPI/2.0[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "X-Content-Type-Options: nosniff[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "DataServiceVersion: 2.0;[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "Date: Fri, 08 Apr 2022 12:27:58 GMT[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "[\r][\n]"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.wire.wire - http-outgoing-24 << "{"d":{"results":[]}}"
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << HTTP/1.1 200 OK
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << Cache-Control: no-cache
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << Content-Length: 20
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << Content-Type: application/json;odata=verbose;charset=utf-8
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << Server: Microsoft-HTTPAPI/2.0
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << X-Content-Type-Options: nosniff
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << DataServiceVersion: 2.0;
08-04-2022 14:27:59.392 [pool-1-thread-2] DEBUG org.apache.http.headers.onResponseReceived - http-outgoing-24 << Date: Fri, 08 Apr 2022 12:27:58 GMT
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.a.h.impl.execchain.MainClientExec.execute - Connection can be kept alive indefinitely
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.a.http.impl.auth.HttpAuthenticator.isAuthenticationRequested - Authentication succeeded
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write status line: HTTP/1.1 200 OK
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: Cache-Control: no-cache
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: Content-Length: 20
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: Content-Type: application/json;odata=verbose;charset=utf-8
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: Server: Microsoft-HTTPAPI/2.0
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: X-Content-Type-Options: nosniff
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: DataServiceVersion: 2.0;
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Write response header: Date: Fri, 08 Apr 2022 12:27:58 GMT
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - Start writing entity content
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager.releaseConnection - Connection [id: 24][route: {}->http://172.16.1.10:8020->http://iis-webserver.local.domain:8020][state: web-user] can be kept alive indefinitely
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection.setSocketTimeout - http-outgoing-24: set socket timeout to 0
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager.releaseConnection - Connection released: [id: 24][route: {}->http://172.16.1.10:8020->http://iis-webserver.local.domain:8020][state: web-user][total available: 2; route allocated: 2 of 20; total allocated: 2 of 600]
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.p.p.NonConnectClientConnectionProcessor.handleRequest - End writing entity content
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG o.k.w.proxy.ClientConnectionHandler.handleConnection - Done handling request: GET http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID%20eq%2012570&$select=ID HTTP/1.1
08-04-2022 14:27:59.393 [pool-1-thread-2] DEBUG org.kpax.winfoom.util.InputOutputs.close - Close socket
08-04-2022 14:28:26.411 [scheduling-1] DEBUG o.k.w.proxy.ConnectionPoolingManager.cleanUpConnectionManager - Execute connection manager pool clean up task

Notice that no logging is being done for the HTTP POST as the socket is closed, without informing the client.

Context information:

  • WinFoom 4.0.2
  • JDK Temurin-17.0.2+8
  • REST client is using Apache HTTP 4.4.1 client with connections sharing enabled through a connection pool.
@sveldhuisen
Copy link
Author

sveldhuisen commented Apr 8, 2022

Some logging on the REST client sending HTTP GET and POST with WinFoom configured as a proxy server:

[04/08/22 14:27:58.845]: TRACE:  Exact Globe: RESTSubscriptionShim.execute() :
[04/08/22 14:27:58.845]: TRACE:  Exact Globe: customHandler
[04/08/22 14:27:58.845]: TRACE:  Exact Globe: customHandler: class-name == 'BusinessEntity'
[04/08/22 14:27:58.845]: TRACE:  Exact Globe: Custom: preparing GET to http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID
[04/08/22 14:27:58.846]: TRACE:  Exact Globe: Resetting headers
[04/08/22 14:27:58.846]: TRACE:  Exact Globe: Setting the following HTTP request properties:
 Authorization: <content suppressed>
[04/08/22 14:27:58.846]: TRACE:  Exact Globe:  Accept:application/json
[04/08/22 14:27:58.846]: TRACE:  Exact Globe:  ServerName:sqldb.local.domain
[04/08/22 14:27:58.847]: TRACE:  Exact Globe:  DatabaseName:123
[04/08/22 14:27:58.847]: TRACE:  Exact Globe:  Cache-Control:no-store, no-cache
[04/08/22 14:27:58.847]: TRACE:  Exact Globe:  Content-Type:application/json; charset=utf-8
[04/08/22 14:27:58.847]: TRACE:  Exact Globe: Annonymous login
[04/08/22 14:27:58.847]: TRACE:  Exact Globe: Did a HTTP GET with 0 bytes of data to http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID
[04/08/22 14:27:58.848]: TRACE:  Exact Globe: *******************************************************
[04/08/22 14:27:58.848]: TRACE:  Exact Globe: **********************LOGGING REQUEST******************
[04/08/22 14:27:58.848]: TRACE:  Exact Globe: *******************************************************
[04/08/22 14:27:58.848]: TRACE:  Exact Globe: Request URL :http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource?$top=1&$filter=ID
[04/08/22 14:27:58.849]: TRACE:  Exact Globe: Http Method : GET
[04/08/22 14:27:58.849]: TRACE:  Exact Globe: Sending http request with below headers :-
[04/08/22 14:27:58.849]: TRACE:  Exact Globe: Authorization: <content suppressed>
[04/08/22 14:27:58.849]: TRACE:  Exact Globe: Accept: application/json
[04/08/22 14:27:58.849]: TRACE:  Exact Globe: ServerName: sqldb.local.domain
[04/08/22 14:27:58.850]: TRACE:  Exact Globe: DatabaseName: 123
[04/08/22 14:27:58.850]: TRACE:  Exact Globe: Cache-Control: no-store, no-cache
[04/08/22 14:27:58.850]: TRACE:  Exact Globe: Content-Type: application/json; charset=utf-8
[04/08/22 14:27:58.850]: TRACE:  Exact Globe: ***************************END**************************
[04/08/22 14:27:59.393]: TRACE:  Exact Globe: ********************************************************
[04/08/22 14:27:59.394]: TRACE:  Exact Globe: ***********************LOGGING RESPONSE*****************
[04/08/22 14:27:59.394]: TRACE:  Exact Globe: ********************************************************
[04/08/22 14:27:59.394]: TRACE:  Exact Globe: Http response code : 200
[04/08/22 14:27:59.394]: TRACE:  Exact Globe: Http response status : HTTP/1.1 200 OK
[04/08/22 14:27:59.394]: TRACE:  Exact Globe: Getting http response with below headers :-
[04/08/22 14:27:59.395]: TRACE:  Exact Globe: Via: 1.1 winfoom
[04/08/22 14:27:59.395]: TRACE:  Exact Globe: Cache-Control: no-cache
[04/08/22 14:27:59.395]: TRACE:  Exact Globe: Content-Length: 20
[04/08/22 14:27:59.395]: TRACE:  Exact Globe: Content-Type: application/json;odata=verbose;charset=utf-8
[04/08/22 14:27:59.395]: TRACE:  Exact Globe: Server: Microsoft-HTTPAPI/2.0
[04/08/22 14:27:59.396]: TRACE:  Exact Globe: X-Content-Type-Options: nosniff
[04/08/22 14:27:59.396]: TRACE:  Exact Globe: DataServiceVersion: 2.0;
[04/08/22 14:27:59.396]: TRACE:  Exact Globe: Date: Fri, 08 Apr 2022 12:27:58 GMT
[04/08/22 14:27:59.396]: TRACE:  Exact Globe: Sending http response with body :-
[04/08/22 14:27:59.396]: TRACE:  Exact Globe: {"d":{"results":[]}}
[04/08/22 14:27:59.396]: TRACE:  Exact Globe: **********************END*****************************
[04/08/22 14:27:59.397]: TRACE:  Exact Globe: Response code and message: 200 OK

[04/08/22 14:27:59.420]: TRACE:  Exact Globe: RESTSubscriptionShim.execute() :
[04/08/22 14:27:59.420]: TRACE:  Exact Globe: customHandler
[04/08/22 14:27:59.420]: TRACE:  Exact Globe: customHandler: class-name == 'BusinessEntity'
[04/08/22 14:27:59.421]: TRACE:  Exact Globe: Custom: preparing POST to http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource
[04/08/22 14:27:59.421]: TRACE:  Exact Globe: Resetting headers
[04/08/22 14:27:59.421]: TRACE:  Exact Globe: Setting the following HTTP request properties:
 Authorization: <content suppressed>
[04/08/22 14:27:59.422]: TRACE:  Exact Globe:  Accept:application/json
[04/08/22 14:27:59.422]: TRACE:  Exact Globe:  ServerName:sqldb.local.domain
[04/08/22 14:27:59.422]: TRACE:  Exact Globe:  DatabaseName:123
[04/08/22 14:27:59.422]: TRACE:  Exact Globe:  Cache-Control:no-store, no-cache
[04/08/22 14:27:59.422]: TRACE:  Exact Globe:  Content-Type:application/json; charset=utf-8
[04/08/22 14:27:59.423]: TRACE:  Exact Globe: Annonymous login
[04/08/22 14:27:59.423]: TRACE:  Exact Globe: Did a HTTP POST with 239 bytes of data to http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource
[04/08/22 14:27:59.423]: TRACE:  Exact Globe: *******************************************************
[04/08/22 14:27:59.423]: TRACE:  Exact Globe: **********************LOGGING REQUEST******************
[04/08/22 14:27:59.424]: TRACE:  Exact Globe: *******************************************************
[04/08/22 14:27:59.424]: TRACE:  Exact Globe: Request URL :http://iis-webserver.local.domain:8020/services/Exact.Entity.REST.EG/Resource
[04/08/22 14:27:59.424]: TRACE:  Exact Globe: Http Method : POST
[04/08/22 14:27:59.424]: TRACE:  Exact Globe: Sending http request with below headers :-
[04/08/22 14:27:59.425]: TRACE:  Exact Globe: Authorization: <content suppressed>
[04/08/22 14:27:59.425]: TRACE:  Exact Globe: Accept: application/json
[04/08/22 14:27:59.425]: TRACE:  Exact Globe: ServerName: sqldb.local.domain
[04/08/22 14:27:59.425]: TRACE:  Exact Globe: DatabaseName: 123
[04/08/22 14:27:59.425]: TRACE:  Exact Globe: Cache-Control: no-store, no-cache
[04/08/22 14:27:59.426]: TRACE:  Exact Globe: Content-Type: application/json; charset=utf-8
[04/08/22 14:27:59.426]: TRACE:  Exact Globe: ***************************END**************************
[04/08/22 14:27:59.426]: TRACE:  Remote Loader: SubscriptionShim.execute() returned:
[04/08/22 14:27:59.427]: TRACE:  IOException: iis-webserver.local.domain:8020 failed to respond</status>

@ecovaci
Copy link
Owner

ecovaci commented Apr 8, 2022

You are absolutely right, and I had to assume this unwanted behavior since the application inception. The issue starts with the fact that a MITM(man-in-the-middle) piece of software like Winfoom cannot honor connection keep-alive HTTP directive for obvious reasons, hence the socket close action on each request. Fortunately this happens only at software level - behind the scene, there are some mechanisms to reuse connections (at OS level) - hence the performance doesn't drop. Since Keep-alive connections are enabled by default in HTTP/1.1 the only way to notify a client about the socket close action is by adding Connection: close header to override the default behavior. It would likely work, but I didn't try.

@sveldhuisen
Copy link
Author

sveldhuisen commented Apr 8, 2022

Hi Eugen,

That is a blazing fast response, thanks for your input in this matter. Unfortunately I don't have full control on the code of the REST client, so I can't change the behaviour on that side (i.e. remove the connection pooling or Keepalive headers).

As I'm not very familiar with the WinFoom code yet, could you give me some hints were I can add the Connection: Close header, without affecting the HTTP connections to the actual endpoint?

@ecovaci
Copy link
Owner

ecovaci commented Apr 8, 2022

It is very simple to add, I will create a new branch and do it myself. I'll let you know when it's done

@sveldhuisen
Copy link
Author

I think I have found the right spot:

diff --git a/src/main/java/org/kpax/winfoom/proxy/processor/NonConnectClientConnectionProcessor.java b/src/main/java/org/kpax/winfoom/proxy/processor/NonConnectClientConnectionProcessor.java
index 4f420f9..d317ba2 100644
--- a/src/main/java/org/kpax/winfoom/proxy/processor/NonConnectClientConnectionProcessor.java
+++ b/src/main/java/org/kpax/winfoom/proxy/processor/NonConnectClientConnectionProcessor.java
@@ -108,6 +108,7 @@ class NonConnectClientConnectionProcessor extends ClientConnectionProcessor {
                             clientConnection.write(header);
                         }
                     }
+                    clientConnection.write("Connection: close");

                     // Empty line marking the end
                     // of header's section

@ecovaci
Copy link
Owner

ecovaci commented Apr 8, 2022

Yes, you still have to remove the existent one contained by the response (if any). See test-connection-close branch, I have made the modification. Can you take from here? Otherwise I can make a pre-release for you.

@sveldhuisen
Copy link
Author

Yes, you still have to remove the existent one contained by the response (if any). See test-connection-close branch, I have made the modification. Can you take from here? Otherwise I can make a pre-release for you.

I can take it from there. Thank you very much!

@ecovaci
Copy link
Owner

ecovaci commented Apr 8, 2022

You welcome. Please let me know how it worked.

@sveldhuisen
Copy link
Author

sveldhuisen commented Apr 8, 2022

Just made a maven build and did some testing: it works beautifully. Thanks again!

@ecovaci
Copy link
Owner

ecovaci commented Apr 8, 2022

If there are no side effects, I can merge it into master and make a new release.

@sveldhuisen
Copy link
Author

If there are no side effects, I can merge it into master and make a new release.

For my specific usecase there are no side effects. Ofcourse I did not do a full unit test on all the functionality. But I expect no side effects as the socket close was already in place: this only fixes the client behaviour about communicating the connection has been closed.

@ecovaci
Copy link
Owner

ecovaci commented Apr 8, 2022

I'll do some testing myself then issue a new release. Thanks for your interest in this project.

@sveldhuisen
Copy link
Author

You are welcome! Before making a release: I noticed that using encode() for the password within a JSON file is not being interpreted. I'll file a new issue for that.

@ecovaci
Copy link
Owner

ecovaci commented Apr 9, 2022

Solved in v4.0.3

@ecovaci ecovaci closed this as completed Apr 9, 2022
@ecovaci ecovaci self-assigned this Apr 9, 2022
@ecovaci ecovaci added bug Something isn't working status:fixed The issue has been fixed labels Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:fixed The issue has been fixed
Projects
None yet
Development

No branches or pull requests

2 participants