All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.higgs.ws.sockjs.SockJSProtocol Maven / Gradle / Ivy

There is a newer version: 0.0.24
Show newest version
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