Module: SockJS
- Defined in:
- lib/sockjs/transports/websocket.rb,
lib/sockjs/session.rb,
lib/sockjs/version.rb,
lib/sockjs/protocol.rb,
lib/sockjs/callbacks.rb,
lib/sockjs/transport.rb,
lib/sockjs/connection.rb,
lib/sockjs/transports/xhr.rb,
lib/sockjs/servers/request.rb,
lib/sockjs/transports/info.rb,
lib/sockjs/servers/response.rb,
lib/sockjs/transports/jsonp.rb,
lib/sockjs/transports/iframe.rb,
lib/sockjs/transports/htmlfile.rb,
lib/sockjs/delayed-response-body.rb,
lib/sockjs/transports/eventsource.rb,
lib/sockjs/transports/welcome_screen.rb,
lib/sockjs/examples/protocol_conformance_test.rb,
lib/sockjs.rb
Overview
Raw WebSocket url: /websocket
SockJS protocol defines a bit of higher level framing. This is okay when the browser using SockJS-client establishes the connection, but it’s not really appropriate when the connection is being established from another program. Although SockJS focuses on server-browser communication, it should be straightforward to connect to SockJS from command line or some any programming language.
In order to make writing command-line clients easier, we define this ‘/websocket` entry point. This entry point is special and doesn’t use any additional custom framing, no open frame, no heartbeats. Only raw WebSocket protocol.
Defined Under Namespace
Modules: CallbackMixin, Examples, Protocol, Transports Classes: CloseError, Connection, ConsumingTransport, DelayedResponseBody, DelayedResponseChunkedBody, DeliveryTransport, Endpoint, HttpError, InvalidJSON, PollingConsumingTransport, Request, Response, Session, SessionEndpoint, SessionUnavailableError, Transport, WebSocketSession
Constant Summary collapse
- PROTOCOL_VERSION =
SockJS protocol version.
[0, 3, 4]
- PROTOCOL_VERSION_STRING =
PROTOCOL_VERSION.join(".")
- PATCH_VERSION =
Patch version of the gem.
[0]
- GEM_VERSION =
(PROTOCOL_VERSION + PATCH_VERSION).join(".")
Class Method Summary collapse
- .debug(message) ⇒ Object
- .debug! ⇒ Object
- .debug? ⇒ Boolean
- .debug_exception(exception) ⇒ Object
- .no_debug! ⇒ Object
- .puts(message) ⇒ Object
Class Method Details
.debug(message) ⇒ Object
32 33 34 |
# File 'lib/sockjs.rb', line 32 def self.debug() self.puts("~ #{}") end |
.debug! ⇒ Object
14 15 16 |
# File 'lib/sockjs.rb', line 14 def self.debug! @debug = true end |
.debug? ⇒ Boolean
22 23 24 |
# File 'lib/sockjs.rb', line 22 def self.debug? @debug end |
.debug_exception(exception) ⇒ Object
36 37 38 |
# File 'lib/sockjs.rb', line 36 def self.debug_exception(exception) self.debug(([exception.class.name, exception.].join(": ") + exception.backtrace).join("\n")) end |
.no_debug! ⇒ Object
18 19 20 |
# File 'lib/sockjs.rb', line 18 def self.no_debug! @debug = false end |
.puts(message) ⇒ Object
26 27 28 29 30 |
# File 'lib/sockjs.rb', line 26 def self.puts() if self.debug? STDERR.puts() end end |