sp-websocket-mapping-01.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?xml version="1.0" encoding="US-ASCII"?>
  2. <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
  3. <rfc category="info" docName="sp-websocket-mapping-01">
  4. <front>
  5. <title abbrev="WebSocket mapping for SPs">
  6. WebSocket Mapping for Scalability Protocols
  7. </title>
  8. <author fullname="Martin Sustrik" initials="M." role="editor"
  9. surname="Sustrik">
  10. <address>
  11. <email>sustrik@250bpm.com</email>
  12. </address>
  13. </author>
  14. <author fullname="Garrett D'Amore" initials="G."
  15. surname="D'Amore">
  16. <address>
  17. <email>garrett@damore.org</email>
  18. </address>
  19. </author>
  20. <date month="February" year="2015" />
  21. <area>Applications</area>
  22. <workgroup>Internet Engineering Task Force</workgroup>
  23. <keyword>WebSocket</keyword>
  24. <keyword>SP</keyword>
  25. <abstract>
  26. <t>This document defines the WebSocket mapping for scalability
  27. protocols.</t>
  28. </abstract>
  29. </front>
  30. <middle>
  31. <section title = "Underlying protocol">
  32. <t>This mapping should be layered on the top of WebSocket protocol
  33. as defined in RFC 6455.</t>
  34. </section>
  35. <section title = "Connection initiation">
  36. <t>Standard WebSocket handshake is done following RFC 6455.</t>
  37. <t>The Sec-WebSocket-Protocol field
  38. MUST be set in the client's HTTP request to match the protocol used
  39. by the WebSocket server. Accordingly, the following values should
  40. be used.</t>
  41. <t>pair.sp.nanomsg.org (NN_PAIR client and server)</t>
  42. <t>req.sp.nanomsg.org (NN_REQ server, NN_REP client)</t>
  43. <t>rep.sp.nanomsg.org (NN_REP server, NN_REQ client)</t>
  44. <t>pub.sp.nanomsg.org (NN_PUB server, NN_SUB client)</t>
  45. <t>sub.sp.nanomsg.org (NN_SUB server, NN_PUB client)</t>
  46. <t>surveyor.sp.nanomsg.org (NN_SURVEYOR server, NN_RESPONDENT client)</t>
  47. <t>respondent.sp.nanomsg.org (NN_RESPONDENT server, NN_SURVEYOR client)</t>
  48. <t>push.sp.nanomsg.org (NN_PUSH server, NN_PULL client)</t>
  49. <t>pull.sp.nanomsg.org (NN_PULL server, NN_PUSH client)</t>
  50. <t>bus.sp.nanomsg.org (NN_BUS client and server)</t>
  51. <t>If the server supports the requested SP protocol as indicated
  52. by the Sec-WebSocket-Protocol header, then it MUST respond with
  53. the same Sec-WebSocket-Protocol value sent by the client.</t>
  54. <t>If the server does support the requested SP protocol, then it MUST
  55. fail the WebSocket connection using the Close code of 1002, as
  56. specified in RFC 6455.</t>
  57. <t>For example, an NN_REQ client socket, connecting to
  58. an NN_REP server, will send the value rep.sp.nanomsg.org in
  59. the Sec-WebSocket-Protocol field. The NN_REP socket on the
  60. server would then include the same rep.sp.nanomsg.org in its
  61. response.</t>
  62. </section>
  63. <section title = "Message">
  64. <t>SP message maps directly to WebSocket message. The message can be
  65. fragmented as needed. Frame boundaries are ignored by the SP
  66. layer.</t>
  67. <t>When possible, binary frames SHOULD be used in preference to
  68. text frames. If text frames are in use, then SP message payloads
  69. MUST be comprised of legal UTF-8 text only.</t>
  70. </section>
  71. <section anchor="IANA" title="IANA Considerations">
  72. <t>This memo includes no request to IANA.</t>
  73. </section>
  74. <section anchor="Security" title="Security Considerations">
  75. <t>The mapping isn't intended to provide any additional security in
  76. addition to what WebSocket does. DoS concerns are addressed within
  77. the specification.</t>
  78. </section>
  79. </middle>
  80. </rfc>