Issue running gateway-bridge in AWS with application load balancer and wss

Viewed 24

I have a gateway bridge running in a docker container in AWS. If I connect a gateway directly to the EC2 node using ws (non-secure websocket) it works fine. I'm trying to now connect via wss (secure websocket) where the secure endpoint is the application loadbalancer which forwards the traffic to my AWS target group containing the same EC2 instance. The gateway bridge EC2 node only gets the non-secure traffic after it is processed by the load balancer.

What appears to be happening is the gateway sends a message to wss:://router-info which gets correctly gets a 101 return code saying it's forwarding the traffic on to the EC2 node. But the gateway-bridge doesn't process the router-info message, it appears like it is expecting the /gateway/<gateway_eui> message because it says it has this log message:

level=error msg="backend/basicstation: parse gateway id error" error="encoding/hex: invalid byte: U+0072 'r'

Looking at the code, it's trying to parse the gateway_eui, but it actually received the /router-info GET.

I believe this is happening because I didn't configure any of the TLS parameters, which I don't want to do since the application load balancer is actually doing the secure TLS termination and not the gateway-bridge.

Is there a way to configure the gateway-bridge to send back some response to the gateway-bridge (like a no-op kind of message) that allows the gateway to continue the connection process? Thanks for any clues on how to proceed.

2 Answers

Ok, I tried enabling the flag: tls_support_proxy and I'm getting the same results. In looking at the code diff, I'm not sure i understand how it is supposed to work.

I don't see any log entries related to receiving/processing the /router-info GET request. I don't understand how the gateway-bridge starts looking for the gateway/<gateway_eui> message without processing the /router-info message first.

I'm thinking there must be something wrong with my nginx configuration, but I don't know what it could be.

I've gotten farther, but I'm still hitting something I don't understand.

Right now, I'm the /router-info GET is working correctly and returning a URI: wss:///gateway/<gateway_eui>

basic station then parses the uri and complains with this error:
Illegal muxs URI (no port/path etc.): wss:///gateway/<gateway_eui>

Looking at the source code for basic station, it appears that it is expecting the port to be included in the uri and no path appended (/gateway/<gateway_eui>) I'm not sure how this ever works?