Results 6 comments of fankeke

赞! 作者是想告诉我们ss的原理以及如何实现一个简单的ss,核心点并不在于加密或者可靠性。

@tokers @huangnauh 谢谢回复 1 对于第一个,我理解是当时没有ngx.worker.id这个API,所以用了lock的这种方案来实现创建唯一check timer的是吧。 但是,在master分支,代码里面已经用到了ngx.worker.id(在config字典里存放节点信息),这个是怎么回事? 2 对于死锁的问题,我考虑过,但持有timer的worker挂掉后会导致死锁。不过CHECKUP_TIMER_KEY这个值是和os.time相关的,所以挂掉后,CHECKUP_TIMER_KEY值会不同,不会有死锁的问题。 local CHECKUP_TIMER_KEY = "checkups:timer:" .. os.time() 谢谢

@huangnauh 谢谢回复 2 , 之前用lock方式的CHECKUP_TIMER_KEY是不变的是吧,好吧。。。 那么目前的CHECKUP_TIMER_KEY是做什么工作的?

@lebanggit Have you ever called `lim:leaving` in log_by_lua phase ? you could refer the example in README.md , it shows how to do this.

indeed,I checked the code . so there is no need to do this:peers = ngx_palloc(cf->pool, sizeof *peers);

paste your config file ,obj/ngx_modules.c and obj/Makefile