sp-websocket-mapping-01.txt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Internet Engineering Task Force M. Sustrik, Ed.
  2. Internet-Draft
  3. Intended status: Informational G. D'Amore
  4. Expires: August 7, 2015
  5. February 3, 2015
  6. WebSocket Mapping for Scalability Protocols
  7. sp-websocket-mapping-01
  8. Abstract
  9. This document defines the WebSocket mapping for scalability
  10. protocols.
  11. Status of This Memo
  12. This Internet-Draft is submitted in full conformance with the
  13. provisions of BCP 78 and BCP 79.
  14. Internet-Drafts are working documents of the Internet Engineering
  15. Task Force (IETF). Note that other groups may also distribute
  16. working documents as Internet-Drafts. The list of current Internet-
  17. Drafts is at http://datatracker.ietf.org/drafts/current/.
  18. Internet-Drafts are draft documents valid for a maximum of six months
  19. and may be updated, replaced, or obsoleted by other documents at any
  20. time. It is inappropriate to use Internet-Drafts as reference
  21. material or to cite them other than as "work in progress."
  22. This Internet-Draft will expire on August 7, 2015.
  23. Copyright Notice
  24. Copyright (c) 2015 IETF Trust and the persons identified as the
  25. document authors. All rights reserved.
  26. This document is subject to BCP 78 and the IETF Trust's Legal
  27. Provisions Relating to IETF Documents
  28. (http://trustee.ietf.org/license-info) in effect on the date of
  29. publication of this document. Please review these documents
  30. carefully, as they describe your rights and restrictions with respect
  31. to this document. Code Components extracted from this document must
  32. include Simplified BSD License text as described in Section 4.e of
  33. the Trust Legal Provisions and are provided without warranty as
  34. described in the Simplified BSD License.
  35. Sustrik & D'Amore Expires August 7, 2015 [Page 1]
  36. Internet-Draft WebSocket mapping for SPs February 2015
  37. 1. Underlying protocol
  38. This mapping should be layered on the top of WebSocket protocol as
  39. defined in RFC 6455.
  40. 2. Connection initiation
  41. Standard WebSocket handshake is done following RFC 6455.
  42. The Sec-WebSocket-Protocol field MUST be set in the client's HTTP
  43. request to match the protocol used by the WebSocket server.
  44. Accordingly, the following values should be used.
  45. pair.sp.nanomsg.org (NN_PAIR client and server)
  46. req.sp.nanomsg.org (NN_REQ server, NN_REP client)
  47. rep.sp.nanomsg.org (NN_REP server, NN_REQ client)
  48. pub.sp.nanomsg.org (NN_PUB server, NN_SUB client)
  49. sub.sp.nanomsg.org (NN_SUB server, NN_PUB client)
  50. surveyor.sp.nanomsg.org (NN_SURVEYOR server, NN_RESPONDENT client)
  51. respondent.sp.nanomsg.org (NN_RESPONDENT server, NN_SURVEYOR client)
  52. push.sp.nanomsg.org (NN_PUSH server, NN_PULL client)
  53. pull.sp.nanomsg.org (NN_PULL server, NN_PUSH client)
  54. bus.sp.nanomsg.org (NN_BUS client and server)
  55. If the server supports the requested SP protocol as indicated by the
  56. Sec-WebSocket-Protocol header, then it MUST respond with the same
  57. Sec-WebSocket-Protocol value sent by the client.
  58. If the server does support the requested SP protocol, then it MUST
  59. fail the WebSocket connection using the Close code of 1002, as
  60. specified in RFC 6455.
  61. For example, an NN_REQ client socket, connecting to an NN_REP server,
  62. will send the value rep.sp.nanomsg.org in the Sec-WebSocket-Protocol
  63. field. The NN_REP socket on the server would then include the same
  64. rep.sp.nanomsg.org in its response.
  65. Sustrik & D'Amore Expires August 7, 2015 [Page 2]
  66. Internet-Draft WebSocket mapping for SPs February 2015
  67. 3. Message
  68. SP message maps directly to WebSocket message. The message can be
  69. fragmented as needed. Frame boundaries are ignored by the SP layer.
  70. When possible, binary frames SHOULD be used in preference to text
  71. frames. If text frames are in use, then SP message payloads MUST be
  72. comprised of legal UTF-8 text only.
  73. 4. IANA Considerations
  74. This memo includes no request to IANA.
  75. 5. Security Considerations
  76. The mapping isn't intended to provide any additional security in
  77. addition to what WebSocket does. DoS concerns are addressed within
  78. the specification.
  79. Authors' Addresses
  80. Martin Sustrik (editor)
  81. Email: sustrik@250bpm.com
  82. Garrett D'Amore
  83. Email: garrett@damore.org
  84. Sustrik & D'Amore Expires August 7, 2015 [Page 3]