aboutsummaryrefslogtreecommitdiff
path: root/handle.go
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2019-04-26 10:41:44 +0300
committerMarin Ivanov <[email protected]>2019-04-26 16:17:07 +0300
commit174e6b2bbdd299b478ae00875d265c06459c5ad0 (patch)
tree91a698f0d0d04e4817df71b737ba80965e7c856f /handle.go
parent71de5fe35cf826f700459c511ecfd89c6d9f789f (diff)
Add HTTP protocol tarpit
Diffstat (limited to 'handle.go')
-rw-r--r--handle.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/handle.go b/handle.go
index 918f3a8..c153b7d 100644
--- a/handle.go
+++ b/handle.go
@@ -9,12 +9,14 @@ import (
type empty struct{}
type protoHandler func(net.Conn, time.Duration)
-func protocolHandler(proto string) (protoHandler, error) {
+func protocolHandler(proto string) (protoHandler, uint16, error) {
switch proto {
case "ssh":
- return sshHandler, nil
+ return sshHandler, 22, nil
+ case "http":
+ return httpHandler, 80, nil
default:
- return nil, fmt.Errorf("unknown protocol '%s'", proto)
+ return nil, 0, fmt.Errorf("unknown protocol '%s'", proto)
}
}