TCP Proxy in rust

Challenge

Checkpoint 0

  1. Single threaded implentation using simple tcplistener.
  2. Tcplistener accepts connection and we relay data from downstream to upstream.

Checkpoint 1

  1. Single listner port and single upstream.
  2. Epoll implemetation but can only support one connection at a time.

Checkpoint 2

  1. Single listner port and single upstream.
  2. Can handle multiple parallel connections and uses epoll.

Checkpoint 3

The TCP Proxy can

  1. Reads the config file and sets itself up accordingly with the listening ports and the upstreams the customer want to forward the request.
  2. Currently it expects the upstream server is alwasys up and round robins among the avilable.

Checkpoint 4

  1. Handle stream half close.
  2. And do current state based upstream selection and fallback to next upstream server.

Checkpoint 5

  1. Implement closing of idle tcp sessions.
  2. The idle events are processed in main event loop itself.

Checkpoint 6