Nicolas Martyanoff on Nostr: Fun fact, in #Go, you cannot hijack an http.Client or http.Transport connection. So ...
Fun fact, in #Go, you cannot hijack an http.Client or http.Transport connection. So if you're writing a reverse proxy and have to support connection upgrading, you have to implement the client part (to the upstream server) yourself with TCP sockets, http.Request.Write and http.ReadResponse. A bit annoying but it will give me more control anyway.
Published at
2024-11-15 08:52:14Event JSON
{
"id": "c2735257dc97fed88bfd6284b510d213e1c1b63d22336ce83ddaff2d7a9a979f",
"pubkey": "6d91e7b056ab18986298e04a8b278a5e070a726487fd30a599427c79db9070e9",
"created_at": 1731660734,
"kind": 1,
"tags": [
[
"t",
"go"
],
[
"proxy",
"https://fosstodon.org/users/galdor/statuses/113486117895726640",
"activitypub"
]
],
"content": "Fun fact, in #Go, you cannot hijack an http.Client or http.Transport connection. So if you're writing a reverse proxy and have to support connection upgrading, you have to implement the client part (to the upstream server) yourself with TCP sockets, http.Request.Write and http.ReadResponse. A bit annoying but it will give me more control anyway.",
"sig": "fc0b0d5c9a201978ac03f3b7afb262396ed7d755903ffbe5a587bfda70993f90797e5d9f9719eb23e80e1cf4055f6534d466b16b4d33ce6be14fbb15bb5cf910"
}