io.higgs.ws.sockjs.SockJSProtocol Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of websocket Show documentation
Show all versions of websocket Show documentation
Higgs' WebSocket server and client implementation
package io.higgs.ws.sockjs;
import io.higgs.core.method;
import io.higgs.http.server.resource.GET;
import io.higgs.http.server.resource.OPTIONS;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
/**
* @author Courtney Robinson
*/
@method("sockjs")
public class SockJSProtocol {
private Random random = new Random();
@OPTIONS
@GET
public Map info() {
Map data = new HashMap<>();
//Are websockets enabled on the server?
data.put("websocket", true);
//Do transports need to support cookies (ie: for load balancing purposes.
data.put("cookie_needed", true);
data.put("origins", "*:*");
data.put("entropy", random.nextInt());
return data;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy