Results 60 comments of Luo Peng

Since the best format of multi-app Caddyfile still needs a further discussion (https://github.com/caddyserver/caddy/pull/3990), here is a quick implementation via global options (although not recommended): [caddy-ext/layer4](https://github.com/RussellLuo/caddy-ext/tree/master/layer4).

AFAIK, Nginx uses two blocks [`http` and `stream`](https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/#on-the-fly-configuration-example): ``` http { #... server { #... } } stream { #... server { #... } } ``` almost the same idea...

Hi @eth-limo, all handlers except `layer4` in this repo are expected to be used at the HTTP level. If you want to rate limit connections by IP at the TCP...

As for problem (2), I have tested the behavior of Nginx with the following config: ``` server { listen 8080; location /prefix/ { proxy_pass http://127.0.0.1:9090/; # The trailing slash matters....

Instead of cleaning path implicitly within path matchers, how about enhancing the [rewrite](https://caddyserver.com/docs/modules/http.handlers.rewrite) handler to let users do it explicitly if needed? For example, as a possible solution, we can...

I agree with Francis. Technically, the URI scheme ("http" or "https") has no relationship with the TCP port. Therefore, in my opinion, both `http://example.com:443` and `https://example.com:80` are technically valid, although...

@imxyb 你好,谢谢关注! 1. 请问 `m.tw` 是如何初始化的?tick 和 wheelSize 的值是多少? 2. 另外 `m.tw` 里只有这一个 703726s 的任务吗?如果还有别的任务,数量和时间间隔分布大概是怎样的? 3. 异常情况下,这个 703726s 的任务最终是间隔多久执行的?

好的。这两天比较忙,我周末分析一下。

## 复现失败 我用如下代码尝试复现: ```go package main import ( "fmt" "time" "github.com/RussellLuo/timingwheel" ) func main() { tw := timingwheel.NewTimingWheel(time.Millisecond, 3600) tw.Start() defer tw.Stop() exitC := make(chan time.Time, 1) tw.AfterFunc(703726 * time.Second,...

> 使用了atomic只保证了读写currentTime变量那一个操作原子化,但是advanceClock则是先读再判断最后再写入, 会与add函数发生竞争,同理overflow变量也是一样好。 @juine @yunlong0928 两位好!请问具体是什么竞争,以及会导致什么问题,方便具体描述下吗?