diff options
| author | Marin Ivanov <[email protected]> | 2019-04-26 10:41:44 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2019-04-26 16:17:07 +0300 |
| commit | 174e6b2bbdd299b478ae00875d265c06459c5ad0 (patch) | |
| tree | 91a698f0d0d04e4817df71b737ba80965e7c856f /handle.go | |
| parent | 71de5fe35cf826f700459c511ecfd89c6d9f789f (diff) | |
Add HTTP protocol tarpit
Diffstat (limited to 'handle.go')
| -rw-r--r-- | handle.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) } } |
