Results 60 comments of WeidiDeng

I don't think sync.map delete usage is correct here, per [issue](https://github.com/golang/go/issues/40999) and my personal experience with v2ray account management which uses [sync.Map](https://github.com/v2fly/v2ray-core/blob/master/proxy/vless/validator.go#L31). If using delete to remove entry, memory will...

Recently, I am using forward_auth to develop my own authorization for [ttyd](https://github.com/tsl0922/ttyd), which uses websocket for communication. I use ttyd to manage server including caddy configuration. Since caddy will always...

I see this doesn't follow caddyhttp.App's GracePeriod, perhaps when cleaning up, there need to be a delay. caddyhttp.ServerCtxKey can be used on a http.request to extract the relevant caddyhttp.App instance....

> Interesting use case; usually, we'd probably want to configure the server by making the server itself pluggable. For example, we have a separate namespace for listener wrappers that configures...

By the way, the lingering connection bug is like [this](https://github.com/golang/go/issues/36093). It causes remote api to be unresponsive. The server will behave like configuration not changed, and I can see from...

TLS is used, like [caddy-l4](https://github.com/mholt/caddy-l4). But I make it a listener wrapper to simplify caddyfile parsing. I can simply add a domain and it will have a tls certificate, no...

Here is a demo that shows what I want to achive and how I achieved it ``` package main import ( "bufio" "context" "crypto/tls" "github.com/caddyserver/certmagic" "golang.org/x/net/http2" "log" "net" "net/http" "sync"...

It's actually more difficult than it seems, golang http.server will do background read one byte from underlying net.Conn unless hijacked. Unless there are listener related caddy namespace added, it will...

Turns out not that difficult either. Underlying conn need to implement a similar method like http.Hijacker to prevent orginal http handler goroutine to modify its state.