TCP load balancing and rerouting based on first few bytes

痴心易碎 提交于 2021-02-09 14:27:32

问题


I have made a game where clients connect to a central server with TCP connection. In the first 6 bytes I send the version number "00.00.01" of the client protocol. Based on this version I want to route/proxy the tcp connection to different servers where different version of the game will be running.

Basically client-1 with version 00.00.01 should connect to Server-1 And client 2 with version 00.00.02 should connect to Server-2

For load balancing I checked HAProxy lua support but couldn't find the solution. Does this kind of solution exist in NginX?

What are the best practices around?


回答1:


Why not have the game itself know which hostname to connect to? Then you can use DNS and virtual hosting to manage which physical machine that ends up mapping to.



来源:https://stackoverflow.com/questions/35837978/tcp-load-balancing-and-rerouting-based-on-first-few-bytes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!