Code Monkey home page Code Monkey logo

Comments (15)

arouel avatar arouel commented on September 28, 2024

If I look at the early Jetty 9 implementation it works with Servlet 3.0. I assume it is sufficient enough.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

I think we should focus on making it work portably in Servlet 3.1, and then we can look for backward compatibility using proprietary APIs if there is demand. It should work on Jetty >= 9.1 and Tomcat >= 8.

I'm adding code to detect the Servlet API for http4s/http4s#15. From there, I think we can implement an HttpUpgradeHandler and extract the Blaze implementation for frame parsing. I looked at JSR 356, and it looked awkward to me.

from http4s-servlet.

bryce-anderson avatar bryce-anderson commented on September 28, 2024

I have a feeling this is going to have some sweeping effects on websocket support such as the types etc, so I'm going to close the older, likely stale issues that will probably be covered.

from http4s-servlet.

mdedetrich avatar mdedetrich commented on September 28, 2024

Also agree that we should focus on making it work cleanly with Servlet 3.1, and maybe provide backends for things like Atmosphere on earlier versions

Similar to what I plan to do with sessions, it makes sense to just make an abstract websocket API, and have one of its backends as "servlet" (which would imply Servlet 3.1), if you don't run Servlet 3.1 then you can plugin a different backend

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

Enough other nice things are getting done, I think we should bump this from 0.5. I'd still like to finish http4s/http4s#15 since it's half done already, and paves the way toward this.

from http4s-servlet.

bryce-anderson avatar bryce-anderson commented on September 28, 2024

+1, bump it.

On Wed, Dec 3, 2014 at 11:36 AM, Ross A. Baker [email protected]
wrote:

Enough other nice things are getting done, I think we should bump this
from 0.5. I'd still like to finish http4s/http4s#15
http4s/http4s#15 since it's half done
already, and paves the way toward this.


Reply to this email directly or view it on GitHub
#7.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

Tomcat 8 seems to support upgrades to arbitrary HttpUpgradeHandlers. Jetty 9, on the other hand, does this. It appears that we're not going to be able to support web sockets via the vanilla servlet 3.1 API.

from http4s-servlet.

ijuma avatar ijuma commented on September 28, 2024

Do I understand correctly that websocket support only works with Blaze and not Servlet?

from http4s-servlet.

bryce-anderson avatar bryce-anderson commented on September 28, 2024

@ijuma at the present time that is correct.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

In theory, we should be able to use an HttpUpgradeHandler with new async I/O support and share a lot of the code with Blaze. In practice, Jetty never initializes the handler.

The standard servlet way of doing web sockets is JSR 356, but that seems to want to map its own handler to known paths. I haven't quite worked out how to integrate that into our model. So I feel like we're close, but that's where we got stuck. Ideas welcome, because I'd like to see this implemented.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

Jetty's is still not implemented.

I think if we had a WebSocketServletFactory hanging around, we might be able to forward requests to that when we want to perform an upgrade. We'd need a JettyHttp4sServlet instead of an Http4sServlet, but I suspect this could work.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

@jmcardon has shown interest in this.

Upgrade handling is still not implemented in Jetty. I continue to believe that this can't be done on a servlet while maintaining the "websocket is embedded in a plain HTTP Response" model. If we had a special Request => F[WebSocket] shape, then I think it could be done with the servlet JSRs.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

This is implemented in Jetty 10. Not a huge priority, but we can give this another go.

from http4s-servlet.

toby5box avatar toby5box commented on September 28, 2024

Bump. Is this moribund now? We use Tomcat 8 and http4s 0.21 and are considering Websockets.

from http4s-servlet.

rossabaker avatar rossabaker commented on September 28, 2024

I couldn't make it work several years ago, but I still think the key to fit it into the existing model is to implement an HttpUpgradeHandler. Once you get that WebCnnection, it seems the rest would snap into place.

Tomcat has a WsHttpUpgradHandler, but it steers toward that WebSocket JSR that doesn't fit the other backends' model. I think it could be inspirational, however.

from http4s-servlet.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.