Commit Graph

9 Commits

Author SHA1 Message Date
root ec41202b3c fix(gost): use chain.NewNode() to properly initialize marker for failover
When creating temporary Node instances with struct literals like
&chain.Node{Addr: host}, the marker field was not initialized.
Only chain.NewNode() properly initializes marker = selector.NewFailMarker().

Without a valid marker:
- Failed nodes cannot be marked (marker.Mark() is no-op on nil)
- Subsequent selections cannot filter out failed nodes
- Failover mechanism completely fails

Fixed locations:
- sniffer.go dial(): &chain.Node{Addr: host} -> chain.NewNode("", host)
- sniffer.go dialTLS(): &chain.Node{Addr: host} -> chain.NewNode("", host)
- local/handler.go: target := &chain.Node{} -> var target *chain.Node
- remote/handler.go: &chain.Node{Addr: host} -> chain.NewNode("", host)
2026-02-04 23:10:56 +00:00
root a98057d06a fix(gost): implement failover for multi-node forwarding rules (#12)
When a forwarding rule has multiple backend nodes configured, the first
node failure would cause the entire forward to fail instead of trying
the next available node.

Root causes fixed:
- FailFilter skipped filtering when only 1 node remained
- hop.Select() bypassed selector for single-node hops
- Handlers only attempted one node before giving up

Changes:
- selector/filter.go: Remove len<=1 early return, always filter failed nodes
- hop/hop.go: Remove single-node bypass, add ExcludeNodes context support
- ctx/value.go: Add ContextWithExcludeNodes/ExcludeNodesFromContext helpers
- handler/forward/local: Add maxRetries config, implement retry loop
- handler/forward/remote: Add maxRetries config, implement retry loop
- forwarder/sniffer.go: Add retry logic to dial() and dialTLS()

Closes #12
2026-02-04 04:12:38 +00:00
qaq 50e7ff0f36 随机构造自签证书信息,修复屏蔽协议引发的udp问题 2025-10-09 14:55:05 +08:00
qaq d675effd58 修复bug 2025-08-08 19:52:53 +08:00
qaq e313a1953c 去除代理头支持, 增加节点面板通信加密 增加导出sql 2025-07-11 16:24:12 +08:00
qaq 2321a7cb8b 添加强制断开链接 2025-06-30 14:45:21 +08:00
qaq fd6b5ddcdd 修复暂停bug 2025-06-28 23:24:07 +08:00
qaq 34f5015369 修复添加用户后引起的编辑错误 2025-06-28 22:42:20 +08:00
qaq 9fa968d07c init 2025-06-17 12:17:33 +08:00