@@ -10,8 +10,10 @@ import (
1010 "github.com/mushorg/glutton/connection"
1111 "github.com/mushorg/glutton/producer"
1212 "github.com/mushorg/glutton/protocols/interfaces"
13+ spicyHandlers "github.com/mushorg/glutton/protocols/spicy/handlers"
1314 "github.com/mushorg/glutton/protocols/tcp"
1415 "github.com/mushorg/glutton/protocols/udp"
16+ "github.com/spf13/viper"
1517)
1618
1719type TCPHandlerFunc func (ctx context.Context , conn net.Conn , md connection.Metadata ) error
@@ -84,7 +86,11 @@ func MapTCPProtocolHandlers(log interfaces.Logger, h interfaces.Honeypot) map[st
8486 // poor mans check for HTTP request
8587 httpMap := map [string ]bool {"GET " : true , "POST" : true , "HEAD" : true , "OPTI" : true , "CONN" : true }
8688 if _ , ok := httpMap [strings .ToUpper (string (snip ))]; ok {
87- return tcp .HandleHTTP (ctx , bufConn , md , log , h )
89+ if viper .GetBool ("spicy.enabled" ) {
90+ return spicyHandlers .HandleHTTP (ctx , bufConn , md , log , h )
91+ } else {
92+ return tcp .HandleHTTP (ctx , bufConn , md , log , h )
93+ }
8894 }
8995 // poor mans check for RDP header
9096 if bytes .Equal (snip , []byte {0x03 , 0x00 , 0x00 , 0x2b }) {
0 commit comments