Using Scala 2.10 and Akka 2.3.4, I've put together a simple proxy server that accepts incoming TCP connections and then proxies those messages to a remote server. Things are working with plain text, but I'm stuck with SSL.
Briefly, this is how I launch my non-secure server for incoming connections:
val server = system.actorOf(Props(new LegacyTCPServer), name = "my-tcp-server")
implicit val bindingTimeout = Timeout(1.second)
import system.dispatcher // execution context for the future
val boundFuture = IO(Tcp) ? Tcp.Bind(server, endpoint)
boundFuture.onSuccess { case Tcp.Bound(address) =>
println("Fantastic! We have a connection: " + address)
}
I can connect to this server via telnet, but now I'd like to move no to opensl. I guess there must be some configuration options for that, but I can't seem to parse it from the documentation: http://doc.akka.io/docs/akka/2.3.4/scala.html
I have seen some (non-functional) examples using akka 2.2.x that use a TCPPipelineHandler, e.g.,
https://groups.google.com/forum/#!topic/akka-user/auErrrk9wS0
https://github.com/betehess/ping-pong-bot/blob/master/app/ircbot/IrcClient.scala#L183
but TCPPipelineHandler doesn't seem to exist in akka 2.3.x, so that feels like a dead end.
I would love it if someone could provide an example of how to set up a tcp socket over ssl using current versions of Scala & Akka.
Please let me know if you'd like more information. Thanks!