0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

add host flag for relay

This commit is contained in:
KallyDev 2021-10-01 12:55:28 +08:00
parent e19e06a652
commit de454bbf5a
No known key found for this signature in database
GPG key ID: AF86E15D73204987
5 changed files with 38 additions and 14 deletions

View file

@ -291,7 +291,7 @@ func (c *Client) setupLocalRelay() {
if c.Options.Debug {
debugString = "debug"
}
err := tcp.Run(debugString, portStr, c.Options.RelayPassword, strings.Join(c.Options.RelayPorts[1:], ","))
err := tcp.Run(debugString, "localhost", portStr, c.Options.RelayPassword, strings.Join(c.Options.RelayPorts[1:], ","))
if err != nil {
panic(err)
}

View file

@ -15,11 +15,11 @@ import (
func init() {
log.SetLevel("trace")
go tcp.Run("debug", "8081", "pass123", "8082,8083,8084,8085")
go tcp.Run("debug", "8082", "pass123")
go tcp.Run("debug", "8083", "pass123")
go tcp.Run("debug", "8084", "pass123")
go tcp.Run("debug", "8085", "pass123")
go tcp.Run("debug", "localhost", "8081", "pass123", "8082,8083,8084,8085")
go tcp.Run("debug", "localhost", "8082", "pass123")
go tcp.Run("debug", "localhost", "8083", "pass123")
go tcp.Run("debug", "localhost", "8084", "pass123")
go tcp.Run("debug", "localhost", "8085", "pass123")
time.Sleep(1 * time.Second)
}