Use Websocket with Google Compute Engine, HTTP(S) Load balancer

2,460 views
Skip to first unread message

maxime dhalluin

unread,
Dec 20, 2017, 3:14:00 PM12/20/17
to gce-discussion
Hi,

I'm trying to use Websocket with my app powered by GCE.

I'm using HTTPS load balancing and it's seems the load balancer does not like the https because it work on HTTP but not on HTTPS.

You can try my snake test game here (In simple HTTP) =>  http://www.writecontrol.fr/websocket/snake.html

There is an error if you test the same URL with HTTPS =>  https://www.writecontrol.fr/websocket/snake.html
I'm using ingress load balancer extensions/v1beta1


So there is SSL between client and HTTPS load balancer, but not between load balancer and application instances

Logs into the application instance seems correct (No Exception) :

2017-12-20 20:07:04.986  INFO 5 --- [tp1875108260-24] monitoring                               : remoteAddr = 10.240.0.4, forwardedFor = 176.170.4.209, 35.190.37.177, request = /websocket/snake/info GET: 3 ms, 0 Ko


This is the log in GCE load balancing logging

httpRequest: {
remoteIp: "176.170.4.209" 
requestMethod: "GET" 
requestSize: "1940" 
responseSize: "414" 
serverIp: "10.240.0.2" 
status: 501 
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36" 
}
insertId: "148f3zg42bp37f" 
jsonPayload: {
statusDetails: "websocket_handshake_failed" 
}
logName: "projects/writecontrol-1055/logs/requests" 
receiveTimestamp: "2017-12-20T18:47:23.815984409Z" 
resource: {
labels: {
backend_service_name: "" 
forwarding_rule_name: "k8s-fws-default-gateway-preprod-ingress--69a82c51321bbe98" 
project_id: "writecontrol-1055" 
target_proxy_name: "k8s-tps-default-gateway-preprod-ingress--69a82c51321bbe98" 
url_map_name: "k8s-um-default-gateway-preprod-ingress--69a82c51321bbe98" 
zone: "global" 
}
type: "http_load_balancer" 
}
severity: "WARNING" 
timestamp: "2017-12-20T18:47:22.935633707Z" 
trace: "projects/writecontrol-1055/traces/79e8cc41423a19b5a52f6c432257a7d6"



Do you have any suggestions ?
 

maxime dhalluin

unread,
Dec 20, 2017, 3:33:04 PM12/20/17
to gce-discussion

Fady (Google Cloud Platform)

unread,
Dec 25, 2017, 5:02:17 PM12/25/17
to gce-discussion
Maxim, 

You have properly posted the question in the right forum at stackoverflow, as this forum is meant for general discussion of Google Cloud Platform. I noticed that a community member had already commented on your question. I will be monitoring that thread also at stackoverflow for further assistance if needed. Happy coding.

maxime dhalluin

unread,
Dec 25, 2017, 5:58:44 PM12/25/17
to gce-discussion
Ok thx !
Reply all
Reply to author
Forward
0 new messages