|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vertx.groovy.core.sockjs.SockJSServer
abstract class SockJSServer
This is an implementation of the server side part of SockJS
SockJS enables browsers to communicate with the server using a simple WebSocket-like api for sending and receiving messages. Under the bonnet SockJS chooses to use one of several protocols depending on browser capabilities and what apppears to be working across the network.
Available protocols include:
This means, it should just work irrespective of what browser is being used, and whether there are nasty things like proxies and load balancers between the client and the server.
For more detailed information on SockJS, see their website.
On the server side, you interact using instances of SockJSSocket - this allows you to send data to the client or receive data via the SockJSSocket#dataHandler#dataHandler.
You can register multiple applications with the same SockJSServer, each using different path prefixes, each application will have its own handler, and configuration as described by JsonObject
Field Summary | |
---|---|
protected JSockJSServer |
jServer
|
Method Summary | |
---|---|
void
|
bridge(java.util.Map sjsConfig, java.util.List inboundPermitted = [[:]], java.util.List outboundPermitted = [[:]], long authTimeout = * 1000, java.lang.String authAddress = null)
Install an app which bridges the SockJS server to the event bus. |
void
|
installApp(java.util.Map config, groovy.lang.Closure sockHandler)
Install an application |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
protected JSockJSServer jServer
Method Detail |
---|
void bridge(java.util.Map sjsConfig, java.util.List inboundPermitted = [[:]], java.util.List outboundPermitted = [[:]], long authTimeout = * 1000, java.lang.String authAddress = null)
sjsConfig
- The config for the apppermitted
- A list of JSON objects which define inboundPermitted matchesauthAddress
- The address of an authentication/authorisation busmodbridgeAddress
- The address the bridge will listen at for login and lougout.
void installApp(java.util.Map config, groovy.lang.Closure sockHandler)
config
- The application configurationsockHandler
- A handler that will be called when new SockJS sockets are created
Groovy Documentation