fix: tproxy cannot start and load balance panic

This commit is contained in:
mzz2017 committed 2021-08-26 23:25:18 +08:00
1 parent 5cc0f869b7
commit ebb6bca65c
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -184,7 +184,7 @@ ip -6 rule del fwmark 1 table 100
ip -6 route del local ::/0 dev lo table 100
ip6tables -w 2 -t mangle -F SSTP_ONCE
ip6tables -w 2 -t mangle -D PREROUTING -m socket -j SSTP_ONCE
ip6tables -w 2 -t mangle -D PREROUTING -m socket --restore-skmark -j SSTP_ONCE
ip6tables -w 2 -t mangle -X SSTP_ONCE
ip6tables -w 2 -t mangle -F TP_OUT
ip6tables -w 2 -t mangle -D OUTPUT -j TP_OUT
+6 -1
View File
@@ -63,6 +63,7 @@ func getObservatoryResponse(conn *grpc.ClientConn) (r *pb.GetOutboundStatusRespo
func observatoryProducer() {
const product = "observatory"
var conn *grpc.ClientConn
nextLoop:
for {
if ApiPort() == 0 {
time.Sleep(ApiFeedInterval)
@@ -91,7 +92,11 @@ func observatoryProducer() {
css := configure.GetConnectedServers()
for i := range outboundStatus {
_ = mapper.AutoMapper(outboundStatus[i], &os[i])
os[i].Which = css.Get()[tag2WhichIndex[os[i].OutboundTag]]
index := tag2WhichIndex[os[i].OutboundTag]
if index >= css.Len() {
continue nextLoop
}
os[i].Which = css.Get()[index]
}
ApiFeed.ProductMessage(product, os)
}