diff options
Diffstat (limited to 'src/main/scala/com/tylerstonge/honeypot/http')
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala | 1 | ||||
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/http/SimplisticHandler.scala | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala b/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala index edd2b01..8943ee0 100644 --- a/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala +++ b/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala @@ -6,7 +6,6 @@ import akka.actor.{Actor, Props} import akka.event.Logging import akka.io.Tcp._ import akka.io.{IO, Tcp} -import com.tylerstonge.honeypot.SimplisticHandler class HttpListener extends Actor { diff --git a/src/main/scala/com/tylerstonge/honeypot/http/SimplisticHandler.scala b/src/main/scala/com/tylerstonge/honeypot/http/SimplisticHandler.scala new file mode 100644 index 0000000..2fe1409 --- /dev/null +++ b/src/main/scala/com/tylerstonge/honeypot/http/SimplisticHandler.scala @@ -0,0 +1,11 @@ +package com.tylerstonge.honeypot.http + +import akka.actor.Actor +import akka.io.Tcp.{PeerClosed, Received, Write} + +class SimplisticHandler extends Actor { + def receive: Receive = { + case Received(data) => sender() ! Write(data) + case PeerClosed => context.stop(self) + } +} |