mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
disallow connections without the proper messaging
This commit is contained in:
parent
79c81a3c5d
commit
9ab46073e9
1 changed files with 4 additions and 0 deletions
4
relay.go
4
relay.go
|
@ -117,6 +117,10 @@ func (r *Relay) clientCommuncation(id int, connection net.Conn) {
|
||||||
sendMessage("who?", connection)
|
sendMessage("who?", connection)
|
||||||
|
|
||||||
m := strings.Split(receiveMessage(connection), ".")
|
m := strings.Split(receiveMessage(connection), ".")
|
||||||
|
if len(m) != 3 {
|
||||||
|
sendMessage("not enough information", connection)
|
||||||
|
return
|
||||||
|
}
|
||||||
connectionType, codePhrase, metaData := m[0], m[1], m[2]
|
connectionType, codePhrase, metaData := m[0], m[1], m[2]
|
||||||
key := codePhrase + "-" + strconv.Itoa(id)
|
key := codePhrase + "-" + strconv.Itoa(id)
|
||||||
logger := log.WithFields(log.Fields{
|
logger := log.WithFields(log.Fields{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue