Hi all, I've deployed an Internet Relay Chat web client using flet. Due to issues with flet's ability to publish an app for client-side rendering I'm forced to use server-side rendering.
The issue I'm running into is that since the app is running on the server rather than in the user's browser, all users are connecting to the server from the same IP address, which would not allow me to IP-ban bad actors.
The way I've implemented the client is as a socket that binds to the IRC server on port 6667:
def connect(self, hostname: str, port: int = 6667) -> None:
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect((hostname, port))
self.socket.settimeout(10)
I'm wondering if there's any way to proxy the client's IP address (Flet makes this available in Page.client_ip) to the socket. So far I've tried socket.create_connection with the source_address set to the client IP, but this does not work:
OSError: [Errno 99] Cannot assign requested address