mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
use dns to determine relay
This commit is contained in:
parent
1d874b5dbe
commit
5374be1a0f
1 changed files with 16 additions and 2 deletions
|
@ -1,8 +1,22 @@
|
|||
package models
|
||||
|
||||
import "net"
|
||||
|
||||
// TCP_BUFFER_SIZE is the maximum packet size
|
||||
const TCP_BUFFER_SIZE = 1024 * 64
|
||||
|
||||
// DEFAULT_RELAY is the default relay used (can be set using --relay)
|
||||
const DEFAULT_RELAY = "142.93.177.120:9009"
|
||||
const DEFAULT_RELAY6 = "[2604:a880:800:c1::14c:1]:9009"
|
||||
var DEFAULT_RELAY = "croc.schollz.com"
|
||||
var DEFAULT_RELAY6 = "croc6.schollz.com"
|
||||
var DEFAULT_PORT = "9009"
|
||||
|
||||
func init() {
|
||||
iprecords, _ := net.LookupIP(DEFAULT_RELAY)
|
||||
for _, ip := range iprecords {
|
||||
DEFAULT_RELAY = ip.String() + ":" + DEFAULT_PORT
|
||||
}
|
||||
iprecords, _ = net.LookupIP(DEFAULT_RELAY6)
|
||||
for _, ip := range iprecords {
|
||||
DEFAULT_RELAY6 = "[" + ip.String() + "]:" + DEFAULT_PORT
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue