I have a small python server script which creates a websocket connection and accepts base64 encoded IP packets (very similar to this). As of now my script decodes the IP packet and sends it out into the wild acting as a proxy. It attempts to create a basic NAT table but seems to be some what buggy and if any packets are dropped they're never removed from the NAT table/dictionary.
What I would like to do is abstract the websocket script from the proxying functionality. After researching my options it appears HAproxy would be a good possibility. So my question is two fold - 1) is HAProxy a good option for what I'm trying to do, 2) What would be the best way to get the decrypted IP packet from my websocket script to HAProxy so it could preform the actual requests.
Here's a quick overview of the architecture I'm thinking of:
client -websocket-> websocket server(decrypts IP pckt) -> HAProxy