blob: 28cadcdd18041984ffa35616212bfbf3a7dd90e0 [file] [log] [blame]
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category="info" docName="sp-websocket-mapping-01">
<title abbrev="WebSocket mapping for SPs">
WebSocket Mapping for Scalability Protocols
<author fullname="Martin Sustrik" initials="M." role="editor"
<author fullname="Garrett D'Amore" initials="G."
<date month="February" year="2015" />
<workgroup>Internet Engineering Task Force</workgroup>
<t>This document defines the WebSocket mapping for scalability
<section title = "Underlying protocol">
<t>This mapping should be layered on the top of WebSocket protocol
as defined in RFC 6455.</t>
<section title = "Connection initiation">
<t>Standard WebSocket handshake is done following RFC 6455.</t>
<t>The Sec-WebSocket-Protocol field
MUST be set in the client's HTTP request to match the protocol used
by the WebSocket server. Accordingly, the following values should
be used.</t>
<t> (NN_PAIR client and server)</t>
<t> (NN_REQ server, NN_REP client)</t>
<t> (NN_REP server, NN_REQ client)</t>
<t> (NN_PUB server, NN_SUB client)</t>
<t> (NN_SUB server, NN_PUB client)</t>
<t> (NN_SURVEYOR server, NN_RESPONDENT client)</t>
<t> (NN_RESPONDENT server, NN_SURVEYOR client)</t>
<t> (NN_PUSH server, NN_PULL client)</t>
<t> (NN_PULL server, NN_PUSH client)</t>
<t> (NN_BUS client and server)</t>
<t>If the server supports the requested SP protocol as indicated
by the Sec-WebSocket-Protocol header, then it MUST respond with
the same Sec-WebSocket-Protocol value sent by the client.</t>
<t>If the server does support the requested SP protocol, then it MUST
fail the WebSocket connection using the Close code of 1002, as
specified in RFC 6455.</t>
<t>For example, an NN_REQ client socket, connecting to
an NN_REP server, will send the value in
the Sec-WebSocket-Protocol field. The NN_REP socket on the
server would then include the same in its
<section title = "Message">
<t>SP message maps directly to WebSocket message. The message can be
fragmented as needed. Frame boundaries are ignored by the SP
<t>When possible, binary frames SHOULD be used in preference to
text frames. If text frames are in use, then SP message payloads
MUST be comprised of legal UTF-8 text only.</t>
<section anchor="IANA" title="IANA Considerations">
<t>This memo includes no request to IANA.</t>
<section anchor="Security" title="Security Considerations">
<t>The mapping isn't intended to provide any additional security in
addition to what WebSocket does. DoS concerns are addressed within
the specification.</t>