net/http: TLS handshake timeout when call external https from google cloud - go

I met the following error when I call the https link from the google cloud run . It works very well when the program calls the same link from my local computer.
I use golang "net/http" to call the https link. I don't know why it has problem when I deploy the program to the google cloud run.
Does anyone has the same issue as me? Any solution I can borrow?
Thanks in advance.
"Post "https://integrations.thethingsnetwork.org/.....": net/http: TLS handshake timeout"

I had the same issue when running HTTP calls in a different go routine.
Fixed, after saw #AhmetB comment, by removing it.
See also this answer.
Thanks #AhmetB :)

Related

Socket.io with YARP

I am trying to build a system using Socket.io and YARP. Yarp is functioning has a Reverse Proxy to all my Services.
When trying establish a connection to my socket.io service, through yarp, I am getting connection_error:
I noticed there are proper configurations used in other Reversed Proxy solutions that are well documented in Socket.io website:
https://socket.io/docs/v4/reverse-proxy/
However, I can't "translate" what they are doing to YARP. Does anyone know if this is possible?
Thanks in advance
I guess stackoverflow was my rubberduck this time...
I checked in postman the request that was being made through my Yarp Server and turns out it wasn't even hitting the correct path. For yarp to connect to a socket.io server you have to use this kind of path in your configuration file:
It seems that a sokcetio request uses it's own path, so you have to make your reverse proxy match the beggining "socket.io/"

Firefox can’t establish a connection to the server at wss://127.0.0.1

i'm trying to create a realtime app with laravel-websockets package, i followed the steps in laravel documents and also the laravel-websockets package and i did all the thing exact the same as docs, but whenever i try to send an event through the channel i receive this error in the browser console:
Firefox can’t establish a connection to the server at wss://127.0.0.1/app/myKey?protocol=7&client=js&version=6.0.3&flash=false.
does any body know how can i solve this error?
i found a solution for my case here:
https://github.com/beyondcode/laravel-websockets/issues/382#issuecomment-631569344
try this out, i hope it works for you too.
I think this is an SSL related problem. Here you are using wss:// protocol on the localhost. I would suggest you use ws:// protocol instead of wss://.
Hope that this will work.

Light-4j server stops responding to HTTP GET or POST

I am facing some issue with 1.6.5 version.
Sometimes the server stops replying to my http rest calls. The tcpdump indicated proper tcp hand-shake..and http request going. But no response comes from server.
This is basic http get call and no processing on the server is happening. Server should receive this call and should reply back with 200 OK response.
If I restart the server, it starts working again. This issue is intermittent.
Any pointers would be really appreciated
Thanks for posting the question on this site. It is easier to search than in other places.
When the server stops responding to the exact same request after a while, it is very possible that there are some memory leak or connection leak in the business logic. You can put some debug info on the suspected code block or run the application in debug mode in an IDE. Light-4j application is just a plain Java SE application and you can debug it in the IDE to pinpoint the issue easily.
Thanks for the reply. I my case, the issue might have been synchronized section of business logic. One of the REST call was in the critical section and did not return which resulted in blocking of the new REST calls. I am still watching this issue.
Vikram

Gravitee.io websocket connection

I set up an API Gateway through Gravitee.io and a Springboot application, and everything seems to work fine as per the rest endpoints, running in https also.
Now, I would like to open a websocket connection through the same port (8080), but when the client tries to do it, this error come up server-side:
Handshake failed due to invalid Upgrade header: null
Looking for some solutions online, seems like a port issue, which could be potentially easy to manage with a tomcat server. But there is a way to address this issue using Gravitee.io ?
Thanks
I would advice you to create an issue in gravitee.io repository at https://github.com/gravitee-io/issues/issues/new
Websocket is not yet ready within Gravitee.io

How do I debug a websocket server

I'm trying to write a server for a webSocket connection. I've read the spec (76, not 75) carefully. I'm using minefield as the browser.
When I try to create a WebSocket from javascript in the browser:
var ws = new WebSocket("ws://localhost:8766/hoho");
The browser responds with
"Firefox can't establish a connection to the server at ws://localhost:8766/hoho."
My server is getting a valid client handshake request, it sends back the response and then boom.
I've run every example handshake example I can find through my server and I match the given responses exactly in every instance. I'm pretty confident that the return byte stream is correct. I don't need help debugging my code, it's doing what I mean it to do. I need help debugging my use of the handshake protocol since when I give minefield what I think is a correct response it laughs at me.
My question is this: How can I debug this thing? I can think of two possibilities.
Is there any way to get minefield to tell me WHY it's rejecting my handshake?
Is there a working, public, webSocket server service on the web? If there is, I can proxy it, watch the byte streams in both direction and figure out where mine is different.
Does anyone have any ideas in these directions or any other ideas?
Thanks for any help.
I'm in the process of debugging a similar situation, and the tool I'm relying on most is netcat, with some additional use of openssl. Shut down your websocket server and run nc -l 8766. That lets you record exactly what headers are being sent. Turn the websocket server back on and use nc 8766 to paste in those same headers and see the result. openssl s_client -connect localhost:443 will let you make the request with ssl, if that is in your mix.
From there, make sure the responses conform completely to the websocket handshake protocol. For instance, my problem right now is that my responses have Connection: close, which is no good.
About the 2nd possibility.
Yes, there is a websocket server out there.
the jWebSocket demo server at http://jwebsocket.org/demos/chat/chat.htm
hope this helps
Added: Echo socket server at: http://www.websocket.org/echo.html
Here's a jsfiddle that I made from http://www.websocket.org echo websocket server which works in Chrome but not in Firefox 6: http://jsfiddle.net/awDLc/
It is adjusted to use MozWebSocket rather than WebSocket, but perhaps that isn't enough?

Resources