summaryrefslogtreecommitdiff
path: root/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala
diff options
context:
space:
mode:
authorTyler St. Onge <tylertstonge@gmail.com>2020-07-25 22:38:14 -0400
committerTyler St. Onge <tylertstonge@gmail.com>2020-07-25 22:38:14 -0400
commit747b6af76b23650756811d896bf76b4331419784 (patch)
tree2e942c8296567cbe4d57f205f72029a62829bdda /src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala
parent945332ca057383f258c78fd15cbc22f8b8d58a83 (diff)
refine ftp component and add configuration capabilities
Diffstat (limited to 'src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala')
-rw-r--r--src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala
index 3e6606a..b988ba3 100644
--- a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala
+++ b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala
@@ -8,16 +8,16 @@ import akka.io.Tcp._
import akka.io.{IO, Tcp}
import akka.util.ByteString
-class FtpListener extends Actor {
+class FtpListener (port: Int) extends Actor {
val log: LoggingAdapter = Logging(context.system, this)
- IO(Tcp)(context.system) ! Bind(self, new InetSocketAddress("localhost", 2121))
+ IO(Tcp)(context.system) ! Bind(self, new InetSocketAddress("localhost", port))
override def receive: Receive = {
case Bound(localAddress) =>
log.info("listening on {}", localAddress)
case CommandFailed(_: Bind) => context.stop(self)
- case Connected(remote, local) =>
+ case Connected =>
val handler = context.actorOf(Props[FtpHandler])
val connection = sender()
connection ! Register(handler)