Squid proxy server closing my Web Socket connection automatically.

3,520 views
Skip to first unread message

Somnath Mule

unread,
May 12, 2018, 3:01:05 AM5/12/18
to VGLUG
Hello,

I am using squid proxy server (Squid Cache: Version 3.3.8) and my java application is behind the squid proxy server.

My java application contains web socket connection call to the target.

When I start my java application,it try to connect to the target via the proxy using the web socket and it is get connected, but as soon as it get connected and got the response from the target server for first time squid is closing my web socket connection.

I am using HTTPS(443) for the web socket connection.

following is my web socket connection java code:

MultiMap requestHeaders = new CaseInsensitiveHeaders(); //it contains my authentication parameters

HttpClientOptions httpOptions = new HttpClientOptions().setDefaultPort(443).setSsl(true).setKeepAlive(true).setProtocolVersion(HttpVersion.HTTP_1_1);

HttpClient client = Vertx.createHttpClient(httpOptions);//http client creation

client.websocket(443), "test.example.com","/app/websocket/connection", requestHeaders, new WebSocketHandler(), new Handler<Throwable>() {
@Override
public void handle(Throwable event) {
System.out.println("error in web socket connection")
}

});

Note: In WebSocketHandler() I have implemented all my web socket handlers.

can anyone help me out to solve this.
I need persistent web socket connection with my target server.

Thanks and regards,
Somnath

Nirmal Pathak

unread,
May 12, 2018, 3:14:59 AM5/12/18
to VGLUG
Seems like Websocket connection is being closed by Squid as squid proxy doesn't support 'upgrade' request, see http://lists.squid-cache.org/pipermail/squid-users/2017-January/013953.html .

The squid logs can help further diagnose the issue.

Thanks,
Nirmal Pathak.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Let me help my fellow beings; that is all I seek.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Somnath Mule

unread,
May 12, 2018, 3:38:50 AM5/12/18
to vg...@googlegroups.com
Thanks for the reply Nirmal.

I have to use 'upgrade' as I have to establish persistent connection with the target using the web socket via proxy.

Is there any way to solve this issue?

Thanks,
Somnath Mule

--
Please read http://www.catb.org/~esr/faqs/smart-questions.html before posting.
You received this message because you are subscribed to the "Vibrant GNU/Linux User Group".
To stop receiving emails from this group, mail to VGLUG+un...@googlegroups.com
To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG

---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,
Somnath Mule
Software Product Developer
Infiverve Technologies Pvt. Ltd || Flint IT Automation Platform

nilesh vaghela

unread,
May 14, 2018, 1:25:38 AM5/14/18
to vglug
Hi,

We have better experience Web socket connection with Nginx.

I understand it is some time difficult to change reverse proxy server but just a suggestion.

Thanks and Regards.


To stop receiving emails from this group, mail to VGLUG+unsubscribe@googlegroups.com

To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG

---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Regards,
Somnath Mule
Software Product Developer
Infiverve Technologies Pvt. Ltd || Flint IT Automation Platform

--
Please read http://www.catb.org/~esr/faqs/smart-questions.html before posting.
You received this message because you are subscribed to the "Vibrant GNU/Linux User Group".
To stop receiving emails from this group, mail to VGLUG+unsubscribe@googlegroups.com

To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG

---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
ElectroMech Corporation
AWS Consulting Partner
RedHat Training and Sales Partner
302, New York Plaza, Opp. Chief Justice Bunglow,
Bodakdev, Ahmedabad - 380054 

Reply all
Reply to author
Forward
0 new messages