Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 768 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 768 Bytes

sseclient-java

A java implementation of Server Sent Events (SSE), particularly for Firebase streaming.

Check it out:

// for firebase streaming of the root, hit /.json.
final URL url = new URL("https://myapp.firebaseio.com/.json");

// firebase auth requires the secret in the 'auth' querystring parameter
final Map<String, Object> queryParameters = new HashMap<String,Object>();
queryParameters.put("auth", "firebasesecret1230981");

// connect to the server
final SSEClient client = new SSEClient(url, null, 3000, null, queryParameters);

// read off messages indefinitely
for (SSEMessage message : client) {
  System.out.println("Got message: " + message);
}

This is a direct port of sseclient 0.0.3.