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 ws-server Show documentation
Show all versions of ws-server Show documentation
Higgs' WebSocket server implementation
package io.higgs.ws.sockjs;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
/**
* @author Courtney Robinson
*/
@Path("sockjs")
public class SockJSProtocol {
private Random random = new Random();
@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