Skip to content

playframework/play-socket.io

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
April 26, 2019 08:32
November 17, 2022 01:02
May 20, 2022 11:51
October 14, 2022 18:06
October 21, 2022 13:49

Play socket.io support

Twitter Follow Discord GitHub Discussions StackOverflow YouTube Twitch Status OpenCollective

Build Status Maven Repository size Scala Steward badge Mergify Status

This is the Play backend socket.io support.

Features

  • Supports all socket.io features, including polling and WebSocket transports, multiple namespaces, acks, JSON and binary messages.
  • Uses Akka streams to handle namespaces.
  • Supports end to end back pressure, pushing back on the TCP connection for clients that send messages faster than the server can handle them.
  • In-built multi node support via Akka clustering, no need to use sticky load balancing.
  • Straight forward codec DSL for translating socket.io callback messages to high level streamed message types.

Documentation

See the Java and Scala documentation.

Sample apps

Sample apps can be found here.

License and support

This software is copyright 2017 Lightbend, and is licensed under the Apache 2 license. The Lightbend subscription does not cover support for this software.

As this software is still in beta status, no guarantees are made with regards to binary or source compatibility between versions.

Developing

Testing

Integration tests are written in JavaScript using mocha and chai, so that the JavaScript socket.io client can be used, to ensure compatibility with the reference implementation. They can be run by running test in sbt.

There are multiple different backends that the tests are run against, including one implemented in Java, one in Scala, and one in a multi node setup. To debug them, you can start these tests by running runJavaServer, runScalaServer and runMultiNodeServer from sbt, then visit http://localhost:9000. This will bring you to an index page will includes and will run the mocha test suite against the backend you started. From there, you can set breakpoints in the JavaScript, and inspect the communication using your browsers developer tools.

The test runner runs the tests against each of these backends, using phantomjs as the browser, and it extracts the test results out and prints them nicely to the console as the tests are running.

Releasing a new version

See https://github.com/playframework/.github/blob/main/RELEASING.md