Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract transports & and add akka-http http/websocket backend #20

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

kelnos
Copy link

@kelnos kelnos commented Dec 30, 2018

I'm looking to use a socket.io server implementation in an akka-http-based project I'm working on, so I thought I'd try my hand at removing the Servlet dependencies out of the core API. Essentially what I've done:

  • Created HttpRequest and HttpResponse interfaces that abstract the methods used from HttpServletRequest and HttpServletResponse, and have the socket.io APIs use the interface rather than the servlet implementations.
  • Remove the servlet config/context parameters from the various init() methods in the transport interfaces, and have them provided "internally" by the servlet transport implementations.
  • Move all servlet-related classes to a new maven artifact, socket-io-servlet.
  • Create a new akka-http transport backend implementation in a new module, akka-io-akka-http-scala.

Right now it's only building for Scala 2.12; cross-compiles are notoriously annoying to do with maven (to do it right you pretty much have to have multiple POMs), so I'm punting on that for now.

@kelnos kelnos force-pushed the transport-abstraction branch 4 times, most recently from 5cb1fd4 to b0f39d6 Compare December 30, 2018 07:16
When the client doesn't provide a session ID when connecting, we can't
call Transport.getConnection() after Transport.handle() returns, because
the transport machinery will see that there's still no session ID in
the request parameters, and create a new session.  This session won't
have an associated request, so things later will start failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant