mox/http
Mechiel Lukkien 259928ab62
add reverse proxying websocket connections
if we recognize that a request for a WebForward is trying to turn the
connection into a websocket, we forward it to the backend and check if the
backend understands the websocket request. if so, we pass back the upgrade
response and get out of the way, copying bytes between the two. we do log the
total amount of bytes read from the client and written to the client. if the
backend doesn't respond with a websocke response, or an invalid one, we respond
with a regular non-websocket response. and we log details about the failed
connection, should help with debugging and any bug reports.

we don't try to parse the websocket framing, that's between the client and the
backend.  we could try to parse it, in part to protect the backend from bad
frames, but it would be a lot of work and could be brittle in the face of
extensions.

this doesn't yet handle websocket connections when a http proxy is configured.
we'll implement it when someone needs it. we do recognize it and fail the
connection.

for issue #25
2023-05-30 22:11:31 +02:00
..
account.go update to latest bstore (with support for an index on a []string: Message.DKIMDomains), and cyclic data types (to be used for Message.Part soon); also adds a context.Context to database operations. 2023-05-22 14:40:36 +02:00
account.html the mbox export also contains all message flags, so fix the text along the export links 2023-03-29 21:21:43 +02:00
account_test.go deprecate having only localparts in an Account's Destinations, it should always be a full email address 2023-03-09 22:13:56 +01:00
accountapi.json make http(s) path for serving the account and admin pages configurable 2023-03-12 11:52:15 +01:00
admin.go update to latest bstore (with support for an index on a []string: Message.DKIMDomains), and cyclic data types (to be used for Message.Part soon); also adds a context.Context to database operations. 2023-05-22 14:40:36 +02:00
admin.html add reverse proxying websocket connections 2023-05-30 22:11:31 +02:00
admin_test.go change mox to start as root, bind to network sockets, then drop to regular unprivileged mox user 2023-02-27 12:19:55 +01:00
adminapi.json implement a catchall address for a domain 2023-03-29 21:11:43 +02:00
autoconf.go make it easier to run with existing webserver 2023-03-04 00:49:02 +01:00
autoconf_test.go mox! 2023-01-30 14:27:06 +01:00
import.go update to latest bstore (with support for an index on a []string: Message.DKIMDomains), and cyclic data types (to be used for Message.Part soon); also adds a context.Context to database operations. 2023-05-22 14:40:36 +02:00
mtasts.go add basic webserver that can do most of what i need 2023-02-28 22:19:24 +01:00
mtasts_test.go mox! 2023-01-30 14:27:06 +01:00
web.go add reverse proxying websocket connections 2023-05-30 22:11:31 +02:00
web_test.go make http(s) path for serving the account and admin pages configurable 2023-03-12 11:52:15 +01:00
webserver.go add reverse proxying websocket connections 2023-05-30 22:11:31 +02:00
webserver_test.go add reverse proxying websocket connections 2023-05-30 22:11:31 +02:00