Skip to content

Commit

Permalink
improve dmsgweb
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Jun 30, 2024
1 parent e8cd649 commit 5e932db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/dmsgweb/commands/dmsgweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ dmsgweb conf file detected: ` + dmsgwebconffile
dmsgWebLog.Info("dmsg client pk: ", pk.String())
if len(resolveDmsgAddr) > 0 {
dialPK = make([]cipher.PubKey, len(resolveDmsgAddr))
dmsgPorts = make([]uint, dmsgSessions)
dmsgPorts = make([]uint, len(resolveDmsgAddr))
for i, dmsgaddr := range resolveDmsgAddr {
dmsgWebLog.Info("dmsg address to dial: ", dmsgaddr)
dmsgAddr = strings.Split(dmsgaddr, ":")
Expand All @@ -201,7 +201,6 @@ dmsgweb conf file detected: ` + dmsgwebconffile
}
}
}
dmsgWebLog.Info("test")
dmsgC, closeDmsg, err := startDmsg(ctx, pk, sk)
if err != nil {
dmsgWebLog.WithError(err).Fatal("failed to start dmsg")
Expand Down Expand Up @@ -272,15 +271,19 @@ dmsgweb conf file detected: ` + dmsgwebconffile

if len(resolveDmsgAddr) == 0 && len(webPort) == 1 {
if rawTCP[0] {
dmsgWebLog.Debug("proxyTCPConn(-1)")
proxyTCPConn(-1)
} else {
dmsgWebLog.Debug("proxyHTTPConn(-1)")
proxyHTTPConn(-1)
}
} else {
for i := range resolveDmsgAddr {
if rawTCP[i] {
dmsgWebLog.Debug("proxyTCPConn("+fmt.Sprintf("%v",i)+")")
proxyTCPConn(i)
} else {
dmsgWebLog.Debug("proxyHTTPConn("+fmt.Sprintf("%v",i)+")")
proxyHTTPConn(i)
}
}
Expand Down

0 comments on commit 5e932db

Please sign in to comment.