GCloud loadbalancer to follow a redirect

What I am currently doing is this: I have a game server running in Kubernetes engine behind a load balancer. The client connections are upgraded to websockets after the handshake in the server. BUT, the gameserver is handling the authentication of client connections. This has the downside of the the gameserver being spammed with connections and loads it up.

What I am trying to accomplish is this: I would like something other than my game server to authenticate the connection and then hand the valid connection over to the game server. This way, the game server is never loaded up with spammed connections.

Is it possible to set up the load balancer such that it points to an auth server, the auth server validates the headers and returns something like a 302 redirect (to the game server ip), the load balancer then routes the connection to the game server. If the auth server fails to authenticate, it would return a 401 or something not redirecting to the game server.

It is important to keep the the redirection in my control as opposed to having the client handle it. iOS and Android now have hardware validation so the initial connection/request can be trusted/validated to be form an actual device, but doing any redirect or similar at the client level may not be trusted because the calls can be handed off to an ai client at that point to play the game for the user :-/


I would like something other than my game server to authenticate the connection and then hand the valid connection over to the game server. This way, the game server is never loaded up with spammed connections.

It sounds like this is a great application of URL maps.

iOS and Android now have hardware validation so the initial connection/request can be trusted/validated to be form an actual device

Upon what are you basing this assumption? If I know/discover the URL, there's nothing preventing me from making requests to it.

链接地址: http://www.djcxy.com/p/44824.html

上一篇: 用git add解开两行

下一篇: GCloud负载均衡器遵循重定向