@wabot-dev/framework 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/dist/src/channels/cmd/@cmd.js +1 -1
  2. package/dist/src/channels/cmd/CmdChannel.js +1 -1
  3. package/dist/src/channels/telegram/@telegram.js +1 -1
  4. package/dist/src/channels/telegram/TelegramChannel.js +1 -1
  5. package/dist/src/channels/whatsapp/@whatsapp.js +1 -1
  6. package/dist/src/channels/whatsapp/WhatsAppChannel.js +1 -1
  7. package/dist/src/channels/whatsapp/WhatsAppConnection.js +1 -1
  8. package/dist/src/channels/whatsapp/WhatsAppDevConnection.js +2 -2
  9. package/dist/src/channels/whatsapp/WhatsAppProdConnection.js +1 -1
  10. package/dist/src/controller/socket.io/SocketIO.js +1 -1
  11. package/dist/src/logger/Logger.js +1 -1
  12. package/dist/src/server/runChannel.js +1 -1
  13. package/dist/src/server/runServer.js +4 -4
  14. package/package.json +2 -1
  15. package/dist/src/_virtual/XMLHttpRequest.js +0 -7
  16. package/dist/src/_virtual/_commonjsHelpers.js +0 -32
  17. package/dist/src/_virtual/base64id.js +0 -3
  18. package/dist/src/_virtual/binary.js +0 -3
  19. package/dist/src/_virtual/bom-handling.js +0 -3
  20. package/dist/src/_virtual/broadcast-operator.js +0 -3
  21. package/dist/src/_virtual/browser.js +0 -3
  22. package/dist/src/_virtual/browser2.js +0 -3
  23. package/dist/src/_virtual/browser3.js +0 -3
  24. package/dist/src/_virtual/browser4.js +0 -3
  25. package/dist/src/_virtual/browser5.js +0 -3
  26. package/dist/src/_virtual/buffer-util.js +0 -3
  27. package/dist/src/_virtual/buffer-util2.js +0 -3
  28. package/dist/src/_virtual/buffer-util3.js +0 -3
  29. package/dist/src/_virtual/charset.js +0 -3
  30. package/dist/src/_virtual/charset2.js +0 -3
  31. package/dist/src/_virtual/client.js +0 -3
  32. package/dist/src/_virtual/cluster-adapter.js +0 -3
  33. package/dist/src/_virtual/commons.js +0 -3
  34. package/dist/src/_virtual/dbcs-codec.js +0 -3
  35. package/dist/src/_virtual/decodePacket.js +0 -3
  36. package/dist/src/_virtual/encodePacket.js +0 -3
  37. package/dist/src/_virtual/encoding.js +0 -3
  38. package/dist/src/_virtual/encoding2.js +0 -3
  39. package/dist/src/_virtual/engine.io.js +0 -3
  40. package/dist/src/_virtual/in-memory-adapter.js +0 -3
  41. package/dist/src/_virtual/index.js +0 -7
  42. package/dist/src/_virtual/index10.js +0 -3
  43. package/dist/src/_virtual/index11.js +0 -3
  44. package/dist/src/_virtual/index12.js +0 -3
  45. package/dist/src/_virtual/index13.js +0 -3
  46. package/dist/src/_virtual/index14.js +0 -3
  47. package/dist/src/_virtual/index15.js +0 -3
  48. package/dist/src/_virtual/index16.js +0 -3
  49. package/dist/src/_virtual/index17.js +0 -3
  50. package/dist/src/_virtual/index18.js +0 -3
  51. package/dist/src/_virtual/index19.js +0 -3
  52. package/dist/src/_virtual/index2.js +0 -7
  53. package/dist/src/_virtual/index20.js +0 -3
  54. package/dist/src/_virtual/index21.js +0 -3
  55. package/dist/src/_virtual/index22.js +0 -3
  56. package/dist/src/_virtual/index23.js +0 -3
  57. package/dist/src/_virtual/index24.js +0 -3
  58. package/dist/src/_virtual/index25.js +0 -3
  59. package/dist/src/_virtual/index26.js +0 -3
  60. package/dist/src/_virtual/index27.js +0 -3
  61. package/dist/src/_virtual/index28.js +0 -3
  62. package/dist/src/_virtual/index29.js +0 -3
  63. package/dist/src/_virtual/index3.js +0 -7
  64. package/dist/src/_virtual/index30.js +0 -3
  65. package/dist/src/_virtual/index31.js +0 -3
  66. package/dist/src/_virtual/index32.js +0 -3
  67. package/dist/src/_virtual/index33.js +0 -3
  68. package/dist/src/_virtual/index4.js +0 -3
  69. package/dist/src/_virtual/index5.js +0 -3
  70. package/dist/src/_virtual/index6.js +0 -3
  71. package/dist/src/_virtual/index7.js +0 -3
  72. package/dist/src/_virtual/index8.js +0 -6
  73. package/dist/src/_virtual/index9.js +0 -3
  74. package/dist/src/_virtual/inherits.js +0 -3
  75. package/dist/src/_virtual/inherits_browser.js +0 -3
  76. package/dist/src/_virtual/is-binary.js +0 -3
  77. package/dist/src/_virtual/language.js +0 -3
  78. package/dist/src/_virtual/language2.js +0 -3
  79. package/dist/src/_virtual/mediaType.js +0 -3
  80. package/dist/src/_virtual/mediaType2.js +0 -3
  81. package/dist/src/_virtual/namespace.js +0 -3
  82. package/dist/src/_virtual/node.js +0 -3
  83. package/dist/src/_virtual/node2.js +0 -3
  84. package/dist/src/_virtual/node3.js +0 -3
  85. package/dist/src/_virtual/node4.js +0 -3
  86. package/dist/src/_virtual/node5.js +0 -3
  87. package/dist/src/_virtual/parent-namespace.js +0 -3
  88. package/dist/src/_virtual/polling-jsonp.js +0 -3
  89. package/dist/src/_virtual/polling.js +0 -3
  90. package/dist/src/_virtual/polling2.js +0 -3
  91. package/dist/src/_virtual/receiver.js +0 -3
  92. package/dist/src/_virtual/sbcs-codec.js +0 -3
  93. package/dist/src/_virtual/sender.js +0 -3
  94. package/dist/src/_virtual/server.js +0 -3
  95. package/dist/src/_virtual/socket-types.js +0 -3
  96. package/dist/src/_virtual/socket.js +0 -3
  97. package/dist/src/_virtual/socket2.js +0 -3
  98. package/dist/src/_virtual/stream.js +0 -3
  99. package/dist/src/_virtual/transport.js +0 -3
  100. package/dist/src/_virtual/typed-events.js +0 -3
  101. package/dist/src/_virtual/userver.js +0 -3
  102. package/dist/src/_virtual/utf16.js +0 -3
  103. package/dist/src/_virtual/utf32.js +0 -3
  104. package/dist/src/_virtual/utf7.js +0 -3
  105. package/dist/src/_virtual/uws.js +0 -3
  106. package/dist/src/_virtual/validation.js +0 -3
  107. package/dist/src/_virtual/validation2.js +0 -3
  108. package/dist/src/_virtual/validation3.js +0 -3
  109. package/dist/src/_virtual/websocket-server.js +0 -3
  110. package/dist/src/_virtual/websocket.js +0 -7
  111. package/dist/src/_virtual/websocket2.js +0 -3
  112. package/dist/src/_virtual/websocket3.js +0 -3
  113. package/dist/src/_virtual/webtransport.js +0 -3
  114. package/dist/src/_virtual/yeast.js +0 -3
  115. package/dist/src/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -171
  116. package/dist/src/node_modules/base64id/lib/base64id.js +0 -117
  117. package/dist/src/node_modules/body-parser/index.js +0 -96
  118. package/dist/src/node_modules/body-parser/lib/read.js +0 -225
  119. package/dist/src/node_modules/body-parser/lib/types/json.js +0 -222
  120. package/dist/src/node_modules/body-parser/lib/types/raw.js +0 -90
  121. package/dist/src/node_modules/body-parser/lib/types/text.js +0 -95
  122. package/dist/src/node_modules/body-parser/lib/types/urlencoded.js +0 -194
  123. package/dist/src/node_modules/body-parser/lib/utils.js +0 -96
  124. package/dist/src/node_modules/bytes/index.js +0 -180
  125. package/dist/src/node_modules/call-bind-apply-helpers/actualApply.js +0 -24
  126. package/dist/src/node_modules/call-bind-apply-helpers/functionApply.js +0 -13
  127. package/dist/src/node_modules/call-bind-apply-helpers/functionCall.js +0 -13
  128. package/dist/src/node_modules/call-bind-apply-helpers/index.js +0 -29
  129. package/dist/src/node_modules/call-bind-apply-helpers/reflectApply.js +0 -13
  130. package/dist/src/node_modules/call-bound/index.js +0 -31
  131. package/dist/src/node_modules/content-type/index.js +0 -235
  132. package/dist/src/node_modules/cookie/index.js +0 -345
  133. package/dist/src/node_modules/cors/lib/index.js +0 -249
  134. package/dist/src/node_modules/debug/src/browser.js +0 -286
  135. package/dist/src/node_modules/debug/src/common.js +0 -303
  136. package/dist/src/node_modules/debug/src/index.js +0 -23
  137. package/dist/src/node_modules/debug/src/node.js +0 -279
  138. package/dist/src/node_modules/depd/index.js +0 -550
  139. package/dist/src/node_modules/dunder-proto/get.js +0 -42
  140. package/dist/src/node_modules/ee-first/index.js +0 -104
  141. package/dist/src/node_modules/engine.io/build/engine.io.js +0 -73
  142. package/dist/src/node_modules/engine.io/build/parser-v3/index.js +0 -429
  143. package/dist/src/node_modules/engine.io/build/parser-v3/utf8.js +0 -198
  144. package/dist/src/node_modules/engine.io/build/server.js +0 -808
  145. package/dist/src/node_modules/engine.io/build/socket.js +0 -469
  146. package/dist/src/node_modules/engine.io/build/transport.js +0 -131
  147. package/dist/src/node_modules/engine.io/build/transports/index.js +0 -37
  148. package/dist/src/node_modules/engine.io/build/transports/polling-jsonp.js +0 -53
  149. package/dist/src/node_modules/engine.io/build/transports/polling.js +0 -346
  150. package/dist/src/node_modules/engine.io/build/transports/websocket.js +0 -106
  151. package/dist/src/node_modules/engine.io/build/transports/webtransport.js +0 -76
  152. package/dist/src/node_modules/engine.io/build/transports-uws/index.js +0 -20
  153. package/dist/src/node_modules/engine.io/build/transports-uws/polling.js +0 -378
  154. package/dist/src/node_modules/engine.io/build/transports-uws/websocket.js +0 -85
  155. package/dist/src/node_modules/engine.io/build/userver.js +0 -292
  156. package/dist/src/node_modules/engine.io/node_modules/accepts/index.js +0 -250
  157. package/dist/src/node_modules/engine.io/node_modules/debug/src/browser.js +0 -285
  158. package/dist/src/node_modules/engine.io/node_modules/debug/src/common.js +0 -285
  159. package/dist/src/node_modules/engine.io/node_modules/debug/src/index.js +0 -23
  160. package/dist/src/node_modules/engine.io/node_modules/debug/src/node.js +0 -279
  161. package/dist/src/node_modules/engine.io/node_modules/mime-db/db.json.js +0 -10704
  162. package/dist/src/node_modules/engine.io/node_modules/mime-db/index.js +0 -24
  163. package/dist/src/node_modules/engine.io/node_modules/mime-types/index.js +0 -202
  164. package/dist/src/node_modules/engine.io/node_modules/negotiator/index.js +0 -96
  165. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/charset.js +0 -179
  166. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/encoding.js +0 -193
  167. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/language.js +0 -188
  168. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/mediaType.js +0 -304
  169. package/dist/src/node_modules/engine.io/node_modules/ws/index.js +0 -28
  170. package/dist/src/node_modules/engine.io/node_modules/ws/lib/buffer-util.js +0 -142
  171. package/dist/src/node_modules/engine.io/node_modules/ws/lib/constants.js +0 -21
  172. package/dist/src/node_modules/engine.io/node_modules/ws/lib/event-target.js +0 -303
  173. package/dist/src/node_modules/engine.io/node_modules/ws/lib/extension.js +0 -214
  174. package/dist/src/node_modules/engine.io/node_modules/ws/lib/limiter.js +0 -64
  175. package/dist/src/node_modules/engine.io/node_modules/ws/lib/permessage-deflate.js +0 -528
  176. package/dist/src/node_modules/engine.io/node_modules/ws/lib/receiver.js +0 -719
  177. package/dist/src/node_modules/engine.io/node_modules/ws/lib/sender.js +0 -513
  178. package/dist/src/node_modules/engine.io/node_modules/ws/lib/stream.js +0 -170
  179. package/dist/src/node_modules/engine.io/node_modules/ws/lib/subprotocol.js +0 -73
  180. package/dist/src/node_modules/engine.io/node_modules/ws/lib/validation.js +0 -141
  181. package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket-server.js +0 -559
  182. package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket.js +0 -1363
  183. package/dist/src/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -13
  184. package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -36
  185. package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -66
  186. package/dist/src/node_modules/engine.io-client/build/esm/globals.node.js +0 -92
  187. package/dist/src/node_modules/engine.io-client/build/esm/index.js +0 -17
  188. package/dist/src/node_modules/engine.io-client/build/esm/socket.js +0 -728
  189. package/dist/src/node_modules/engine.io-client/build/esm/transport.js +0 -143
  190. package/dist/src/node_modules/engine.io-client/build/esm/transports/index.js +0 -11
  191. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -256
  192. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +0 -21
  193. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling.js +0 -146
  194. package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -107
  195. package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.node.js +0 -48
  196. package/dist/src/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -83
  197. package/dist/src/node_modules/engine.io-client/build/esm/util.js +0 -62
  198. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js +0 -142
  199. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/constants.js +0 -21
  200. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/event-target.js +0 -303
  201. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/extension.js +0 -214
  202. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/limiter.js +0 -64
  203. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js +0 -528
  204. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/receiver.js +0 -719
  205. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/sender.js +0 -513
  206. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/stream.js +0 -170
  207. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js +0 -73
  208. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/validation.js +0 -141
  209. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js +0 -559
  210. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket.js +0 -1363
  211. package/dist/src/node_modules/engine.io-parser/build/cjs/commons.js +0 -29
  212. package/dist/src/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -70
  213. package/dist/src/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -51
  214. package/dist/src/node_modules/engine.io-parser/build/cjs/index.js +0 -179
  215. package/dist/src/node_modules/engine.io-parser/build/esm/commons.js +0 -15
  216. package/dist/src/node_modules/engine.io-parser/build/esm/decodePacket.js +0 -58
  217. package/dist/src/node_modules/engine.io-parser/build/esm/encodePacket.js +0 -36
  218. package/dist/src/node_modules/engine.io-parser/build/esm/index.js +0 -158
  219. package/dist/src/node_modules/es-define-property/index.js +0 -23
  220. package/dist/src/node_modules/es-errors/eval.js +0 -13
  221. package/dist/src/node_modules/es-errors/index.js +0 -13
  222. package/dist/src/node_modules/es-errors/range.js +0 -13
  223. package/dist/src/node_modules/es-errors/ref.js +0 -13
  224. package/dist/src/node_modules/es-errors/syntax.js +0 -13
  225. package/dist/src/node_modules/es-errors/type.js +0 -13
  226. package/dist/src/node_modules/es-errors/uri.js +0 -13
  227. package/dist/src/node_modules/es-object-atoms/index.js +0 -13
  228. package/dist/src/node_modules/function-bind/implementation.js +0 -93
  229. package/dist/src/node_modules/function-bind/index.js +0 -16
  230. package/dist/src/node_modules/get-intrinsic/index.js +0 -413
  231. package/dist/src/node_modules/get-proto/Object.getPrototypeOf.js +0 -17
  232. package/dist/src/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -13
  233. package/dist/src/node_modules/get-proto/index.js +0 -40
  234. package/dist/src/node_modules/gopd/gOPD.js +0 -13
  235. package/dist/src/node_modules/gopd/index.js +0 -26
  236. package/dist/src/node_modules/has-symbols/index.js +0 -25
  237. package/dist/src/node_modules/has-symbols/shams.js +0 -54
  238. package/dist/src/node_modules/hasown/index.js +0 -19
  239. package/dist/src/node_modules/http-errors/index.js +0 -306
  240. package/dist/src/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -598
  241. package/dist/src/node_modules/iconv-lite/encodings/dbcs-data.js +0 -206
  242. package/dist/src/node_modules/iconv-lite/encodings/index.js +0 -44
  243. package/dist/src/node_modules/iconv-lite/encodings/internal.js +0 -210
  244. package/dist/src/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -83
  245. package/dist/src/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -460
  246. package/dist/src/node_modules/iconv-lite/encodings/sbcs-data.js +0 -187
  247. package/dist/src/node_modules/iconv-lite/encodings/tables/big5-added.json.js +0 -506
  248. package/dist/src/node_modules/iconv-lite/encodings/tables/cp936.json.js +0 -2621
  249. package/dist/src/node_modules/iconv-lite/encodings/tables/cp949.json.js +0 -2380
  250. package/dist/src/node_modules/iconv-lite/encodings/tables/cp950.json.js +0 -729
  251. package/dist/src/node_modules/iconv-lite/encodings/tables/eucjp.json.js +0 -822
  252. package/dist/src/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json.js +0 -424
  253. package/dist/src/node_modules/iconv-lite/encodings/tables/gbk-added.json.js +0 -264
  254. package/dist/src/node_modules/iconv-lite/encodings/tables/shiftjis.json.js +0 -548
  255. package/dist/src/node_modules/iconv-lite/encodings/utf16.js +0 -206
  256. package/dist/src/node_modules/iconv-lite/encodings/utf32.js +0 -329
  257. package/dist/src/node_modules/iconv-lite/encodings/utf7.js +0 -297
  258. package/dist/src/node_modules/iconv-lite/lib/bom-handling.js +0 -61
  259. package/dist/src/node_modules/iconv-lite/lib/index.js +0 -192
  260. package/dist/src/node_modules/iconv-lite/lib/streams.js +0 -120
  261. package/dist/src/node_modules/inherits/inherits.js +0 -21
  262. package/dist/src/node_modules/inherits/inherits_browser.js +0 -38
  263. package/dist/src/node_modules/math-intrinsics/abs.js +0 -13
  264. package/dist/src/node_modules/math-intrinsics/floor.js +0 -13
  265. package/dist/src/node_modules/math-intrinsics/isNaN.js +0 -15
  266. package/dist/src/node_modules/math-intrinsics/max.js +0 -13
  267. package/dist/src/node_modules/math-intrinsics/min.js +0 -13
  268. package/dist/src/node_modules/math-intrinsics/pow.js +0 -13
  269. package/dist/src/node_modules/math-intrinsics/round.js +0 -13
  270. package/dist/src/node_modules/math-intrinsics/sign.js +0 -22
  271. package/dist/src/node_modules/media-typer/index.js +0 -153
  272. package/dist/src/node_modules/mime-db/db.json.js +0 -11656
  273. package/dist/src/node_modules/mime-db/index.js +0 -24
  274. package/dist/src/node_modules/mime-types/index.js +0 -226
  275. package/dist/src/node_modules/mime-types/mimeScore.js +0 -62
  276. package/dist/src/node_modules/ms/index.js +0 -172
  277. package/dist/src/node_modules/object-assign/index.js +0 -99
  278. package/dist/src/node_modules/object-inspect/index.js +0 -557
  279. package/dist/src/node_modules/object-inspect/util.inspect.js +0 -13
  280. package/dist/src/node_modules/on-finished/index.js +0 -245
  281. package/dist/src/node_modules/qs/lib/formats.js +0 -32
  282. package/dist/src/node_modules/qs/lib/index.js +0 -24
  283. package/dist/src/node_modules/qs/lib/parse.js +0 -339
  284. package/dist/src/node_modules/qs/lib/stringify.js +0 -369
  285. package/dist/src/node_modules/qs/lib/utils.js +0 -279
  286. package/dist/src/node_modules/raw-body/index.js +0 -351
  287. package/dist/src/node_modules/safer-buffer/safer.js +0 -88
  288. package/dist/src/node_modules/setprototypeof/index.js +0 -26
  289. package/dist/src/node_modules/side-channel/index.js +0 -58
  290. package/dist/src/node_modules/side-channel-list/index.js +0 -125
  291. package/dist/src/node_modules/side-channel-map/index.js +0 -82
  292. package/dist/src/node_modules/side-channel-weakmap/index.js +0 -99
  293. package/dist/src/node_modules/socket.io/dist/broadcast-operator.js +0 -448
  294. package/dist/src/node_modules/socket.io/dist/client.js +0 -281
  295. package/dist/src/node_modules/socket.io/dist/index.js +0 -837
  296. package/dist/src/node_modules/socket.io/dist/namespace.js +0 -597
  297. package/dist/src/node_modules/socket.io/dist/parent-namespace.js +0 -101
  298. package/dist/src/node_modules/socket.io/dist/socket-types.js +0 -21
  299. package/dist/src/node_modules/socket.io/dist/socket.js +0 -993
  300. package/dist/src/node_modules/socket.io/dist/typed-events.js +0 -92
  301. package/dist/src/node_modules/socket.io/dist/uws.js +0 -149
  302. package/dist/src/node_modules/socket.io/node_modules/accepts/index.js +0 -250
  303. package/dist/src/node_modules/socket.io/node_modules/debug/src/browser.js +0 -285
  304. package/dist/src/node_modules/socket.io/node_modules/debug/src/common.js +0 -285
  305. package/dist/src/node_modules/socket.io/node_modules/debug/src/index.js +0 -23
  306. package/dist/src/node_modules/socket.io/node_modules/debug/src/node.js +0 -279
  307. package/dist/src/node_modules/socket.io/node_modules/mime-db/db.json.js +0 -10704
  308. package/dist/src/node_modules/socket.io/node_modules/mime-db/index.js +0 -24
  309. package/dist/src/node_modules/socket.io/node_modules/mime-types/index.js +0 -202
  310. package/dist/src/node_modules/socket.io/node_modules/negotiator/index.js +0 -96
  311. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/charset.js +0 -179
  312. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/encoding.js +0 -193
  313. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/language.js +0 -188
  314. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/mediaType.js +0 -304
  315. package/dist/src/node_modules/socket.io/package.json.js +0 -5
  316. package/dist/src/node_modules/socket.io/wrapper.js +0 -5
  317. package/dist/src/node_modules/socket.io-adapter/dist/cluster-adapter.js +0 -689
  318. package/dist/src/node_modules/socket.io-adapter/dist/contrib/yeast.js +0 -64
  319. package/dist/src/node_modules/socket.io-adapter/dist/in-memory-adapter.js +0 -407
  320. package/dist/src/node_modules/socket.io-adapter/dist/index.js +0 -24
  321. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/browser.js +0 -285
  322. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/common.js +0 -285
  323. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/index.js +0 -23
  324. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/node.js +0 -279
  325. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/index.js +0 -28
  326. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/buffer-util.js +0 -142
  327. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/constants.js +0 -21
  328. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/event-target.js +0 -303
  329. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/extension.js +0 -214
  330. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/limiter.js +0 -64
  331. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/permessage-deflate.js +0 -528
  332. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/receiver.js +0 -719
  333. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/sender.js +0 -513
  334. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/stream.js +0 -170
  335. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/subprotocol.js +0 -73
  336. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/validation.js +0 -141
  337. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket-server.js +0 -559
  338. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket.js +0 -1363
  339. package/dist/src/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -68
  340. package/dist/src/node_modules/socket.io-client/build/esm/index.js +0 -50
  341. package/dist/src/node_modules/socket.io-client/build/esm/manager.js +0 -373
  342. package/dist/src/node_modules/socket.io-client/build/esm/on.js +0 -8
  343. package/dist/src/node_modules/socket.io-client/build/esm/socket.js +0 -884
  344. package/dist/src/node_modules/socket.io-client/build/esm/url.js +0 -63
  345. package/dist/src/node_modules/socket.io-parser/build/cjs/binary.js +0 -99
  346. package/dist/src/node_modules/socket.io-parser/build/cjs/index.js +0 -337
  347. package/dist/src/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -65
  348. package/dist/src/node_modules/socket.io-parser/build/esm/binary.js +0 -86
  349. package/dist/src/node_modules/socket.io-parser/build/esm/index.js +0 -314
  350. package/dist/src/node_modules/socket.io-parser/build/esm/is-binary.js +0 -52
  351. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/browser.js +0 -285
  352. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/common.js +0 -285
  353. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/index.js +0 -23
  354. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/node.js +0 -279
  355. package/dist/src/node_modules/statuses/codes.json.js +0 -67
  356. package/dist/src/node_modules/statuses/index.js +0 -157
  357. package/dist/src/node_modules/toidentifier/index.js +0 -41
  358. package/dist/src/node_modules/type-is/index.js +0 -263
  359. package/dist/src/node_modules/unpipe/index.js +0 -78
  360. package/dist/src/node_modules/vary/index.js +0 -159
  361. package/dist/src/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +0 -702
@@ -1,1363 +0,0 @@
1
- import require$$0$1 from 'events';
2
- import require$$1$1 from 'https';
3
- import require$$2 from 'http';
4
- import require$$3 from 'net';
5
- import require$$4 from 'tls';
6
- import require$$1 from 'crypto';
7
- import require$$0 from 'stream';
8
- import require$$7 from 'url';
9
- import { __require as requirePermessageDeflate } from './permessage-deflate.js';
10
- import { __require as requireReceiver } from './receiver.js';
11
- import { __require as requireSender } from './sender.js';
12
- import { __require as requireConstants } from './constants.js';
13
- import { __require as requireEventTarget } from './event-target.js';
14
- import { __require as requireExtension } from './extension.js';
15
- import { __require as requireBufferUtil } from './buffer-util.js';
16
-
17
- /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$", "caughtErrors": "none" }] */
18
-
19
- var websocket;
20
- var hasRequiredWebsocket;
21
-
22
- function requireWebsocket () {
23
- if (hasRequiredWebsocket) return websocket;
24
- hasRequiredWebsocket = 1;
25
-
26
- const EventEmitter = require$$0$1;
27
- const https = require$$1$1;
28
- const http = require$$2;
29
- const net = require$$3;
30
- const tls = require$$4;
31
- const { randomBytes, createHash } = require$$1;
32
- const { Duplex, Readable } = require$$0;
33
- const { URL } = require$$7;
34
-
35
- const PerMessageDeflate = requirePermessageDeflate();
36
- const Receiver = requireReceiver();
37
- const Sender = requireSender();
38
- const {
39
- BINARY_TYPES,
40
- EMPTY_BUFFER,
41
- GUID,
42
- kForOnEventAttribute,
43
- kListener,
44
- kStatusCode,
45
- kWebSocket,
46
- NOOP
47
- } = requireConstants();
48
- const {
49
- EventTarget: { addEventListener, removeEventListener }
50
- } = requireEventTarget();
51
- const { format, parse } = requireExtension();
52
- const { toBuffer } = requireBufferUtil();
53
-
54
- const closeTimeout = 30 * 1000;
55
- const kAborted = Symbol('kAborted');
56
- const protocolVersions = [8, 13];
57
- const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
58
- const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
59
-
60
- /**
61
- * Class representing a WebSocket.
62
- *
63
- * @extends EventEmitter
64
- */
65
- class WebSocket extends EventEmitter {
66
- /**
67
- * Create a new `WebSocket`.
68
- *
69
- * @param {(String|URL)} address The URL to which to connect
70
- * @param {(String|String[])} [protocols] The subprotocols
71
- * @param {Object} [options] Connection options
72
- */
73
- constructor(address, protocols, options) {
74
- super();
75
-
76
- this._binaryType = BINARY_TYPES[0];
77
- this._closeCode = 1006;
78
- this._closeFrameReceived = false;
79
- this._closeFrameSent = false;
80
- this._closeMessage = EMPTY_BUFFER;
81
- this._closeTimer = null;
82
- this._extensions = {};
83
- this._paused = false;
84
- this._protocol = '';
85
- this._readyState = WebSocket.CONNECTING;
86
- this._receiver = null;
87
- this._sender = null;
88
- this._socket = null;
89
-
90
- if (address !== null) {
91
- this._bufferedAmount = 0;
92
- this._isServer = false;
93
- this._redirects = 0;
94
-
95
- if (protocols === undefined) {
96
- protocols = [];
97
- } else if (!Array.isArray(protocols)) {
98
- if (typeof protocols === 'object' && protocols !== null) {
99
- options = protocols;
100
- protocols = [];
101
- } else {
102
- protocols = [protocols];
103
- }
104
- }
105
-
106
- initAsClient(this, address, protocols, options);
107
- } else {
108
- this._autoPong = options.autoPong;
109
- this._isServer = true;
110
- }
111
- }
112
-
113
- /**
114
- * This deviates from the WHATWG interface since ws doesn't support the
115
- * required default "blob" type (instead we define a custom "nodebuffer"
116
- * type).
117
- *
118
- * @type {String}
119
- */
120
- get binaryType() {
121
- return this._binaryType;
122
- }
123
-
124
- set binaryType(type) {
125
- if (!BINARY_TYPES.includes(type)) return;
126
-
127
- this._binaryType = type;
128
-
129
- //
130
- // Allow to change `binaryType` on the fly.
131
- //
132
- if (this._receiver) this._receiver._binaryType = type;
133
- }
134
-
135
- /**
136
- * @type {Number}
137
- */
138
- get bufferedAmount() {
139
- if (!this._socket) return this._bufferedAmount;
140
-
141
- return this._socket._writableState.length + this._sender._bufferedBytes;
142
- }
143
-
144
- /**
145
- * @type {String}
146
- */
147
- get extensions() {
148
- return Object.keys(this._extensions).join();
149
- }
150
-
151
- /**
152
- * @type {Boolean}
153
- */
154
- get isPaused() {
155
- return this._paused;
156
- }
157
-
158
- /**
159
- * @type {Function}
160
- */
161
- /* istanbul ignore next */
162
- get onclose() {
163
- return null;
164
- }
165
-
166
- /**
167
- * @type {Function}
168
- */
169
- /* istanbul ignore next */
170
- get onerror() {
171
- return null;
172
- }
173
-
174
- /**
175
- * @type {Function}
176
- */
177
- /* istanbul ignore next */
178
- get onopen() {
179
- return null;
180
- }
181
-
182
- /**
183
- * @type {Function}
184
- */
185
- /* istanbul ignore next */
186
- get onmessage() {
187
- return null;
188
- }
189
-
190
- /**
191
- * @type {String}
192
- */
193
- get protocol() {
194
- return this._protocol;
195
- }
196
-
197
- /**
198
- * @type {Number}
199
- */
200
- get readyState() {
201
- return this._readyState;
202
- }
203
-
204
- /**
205
- * @type {String}
206
- */
207
- get url() {
208
- return this._url;
209
- }
210
-
211
- /**
212
- * Set up the socket and the internal resources.
213
- *
214
- * @param {Duplex} socket The network socket between the server and client
215
- * @param {Buffer} head The first packet of the upgraded stream
216
- * @param {Object} options Options object
217
- * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
218
- * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
219
- * multiple times in the same tick
220
- * @param {Function} [options.generateMask] The function used to generate the
221
- * masking key
222
- * @param {Number} [options.maxPayload=0] The maximum allowed message size
223
- * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
224
- * not to skip UTF-8 validation for text and close messages
225
- * @private
226
- */
227
- setSocket(socket, head, options) {
228
- const receiver = new Receiver({
229
- allowSynchronousEvents: options.allowSynchronousEvents,
230
- binaryType: this.binaryType,
231
- extensions: this._extensions,
232
- isServer: this._isServer,
233
- maxPayload: options.maxPayload,
234
- skipUTF8Validation: options.skipUTF8Validation
235
- });
236
-
237
- this._sender = new Sender(socket, this._extensions, options.generateMask);
238
- this._receiver = receiver;
239
- this._socket = socket;
240
-
241
- receiver[kWebSocket] = this;
242
- socket[kWebSocket] = this;
243
-
244
- receiver.on('conclude', receiverOnConclude);
245
- receiver.on('drain', receiverOnDrain);
246
- receiver.on('error', receiverOnError);
247
- receiver.on('message', receiverOnMessage);
248
- receiver.on('ping', receiverOnPing);
249
- receiver.on('pong', receiverOnPong);
250
-
251
- //
252
- // These methods may not be available if `socket` is just a `Duplex`.
253
- //
254
- if (socket.setTimeout) socket.setTimeout(0);
255
- if (socket.setNoDelay) socket.setNoDelay();
256
-
257
- if (head.length > 0) socket.unshift(head);
258
-
259
- socket.on('close', socketOnClose);
260
- socket.on('data', socketOnData);
261
- socket.on('end', socketOnEnd);
262
- socket.on('error', socketOnError);
263
-
264
- this._readyState = WebSocket.OPEN;
265
- this.emit('open');
266
- }
267
-
268
- /**
269
- * Emit the `'close'` event.
270
- *
271
- * @private
272
- */
273
- emitClose() {
274
- if (!this._socket) {
275
- this._readyState = WebSocket.CLOSED;
276
- this.emit('close', this._closeCode, this._closeMessage);
277
- return;
278
- }
279
-
280
- if (this._extensions[PerMessageDeflate.extensionName]) {
281
- this._extensions[PerMessageDeflate.extensionName].cleanup();
282
- }
283
-
284
- this._receiver.removeAllListeners();
285
- this._readyState = WebSocket.CLOSED;
286
- this.emit('close', this._closeCode, this._closeMessage);
287
- }
288
-
289
- /**
290
- * Start a closing handshake.
291
- *
292
- * +----------+ +-----------+ +----------+
293
- * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
294
- * | +----------+ +-----------+ +----------+ |
295
- * +----------+ +-----------+ |
296
- * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING
297
- * +----------+ +-----------+ |
298
- * | | | +---+ |
299
- * +------------------------+-->|fin| - - - -
300
- * | +---+ | +---+
301
- * - - - - -|fin|<---------------------+
302
- * +---+
303
- *
304
- * @param {Number} [code] Status code explaining why the connection is closing
305
- * @param {(String|Buffer)} [data] The reason why the connection is
306
- * closing
307
- * @public
308
- */
309
- close(code, data) {
310
- if (this.readyState === WebSocket.CLOSED) return;
311
- if (this.readyState === WebSocket.CONNECTING) {
312
- const msg = 'WebSocket was closed before the connection was established';
313
- abortHandshake(this, this._req, msg);
314
- return;
315
- }
316
-
317
- if (this.readyState === WebSocket.CLOSING) {
318
- if (
319
- this._closeFrameSent &&
320
- (this._closeFrameReceived || this._receiver._writableState.errorEmitted)
321
- ) {
322
- this._socket.end();
323
- }
324
-
325
- return;
326
- }
327
-
328
- this._readyState = WebSocket.CLOSING;
329
- this._sender.close(code, data, !this._isServer, (err) => {
330
- //
331
- // This error is handled by the `'error'` listener on the socket. We only
332
- // want to know if the close frame has been sent here.
333
- //
334
- if (err) return;
335
-
336
- this._closeFrameSent = true;
337
-
338
- if (
339
- this._closeFrameReceived ||
340
- this._receiver._writableState.errorEmitted
341
- ) {
342
- this._socket.end();
343
- }
344
- });
345
-
346
- //
347
- // Specify a timeout for the closing handshake to complete.
348
- //
349
- this._closeTimer = setTimeout(
350
- this._socket.destroy.bind(this._socket),
351
- closeTimeout
352
- );
353
- }
354
-
355
- /**
356
- * Pause the socket.
357
- *
358
- * @public
359
- */
360
- pause() {
361
- if (
362
- this.readyState === WebSocket.CONNECTING ||
363
- this.readyState === WebSocket.CLOSED
364
- ) {
365
- return;
366
- }
367
-
368
- this._paused = true;
369
- this._socket.pause();
370
- }
371
-
372
- /**
373
- * Send a ping.
374
- *
375
- * @param {*} [data] The data to send
376
- * @param {Boolean} [mask] Indicates whether or not to mask `data`
377
- * @param {Function} [cb] Callback which is executed when the ping is sent
378
- * @public
379
- */
380
- ping(data, mask, cb) {
381
- if (this.readyState === WebSocket.CONNECTING) {
382
- throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
383
- }
384
-
385
- if (typeof data === 'function') {
386
- cb = data;
387
- data = mask = undefined;
388
- } else if (typeof mask === 'function') {
389
- cb = mask;
390
- mask = undefined;
391
- }
392
-
393
- if (typeof data === 'number') data = data.toString();
394
-
395
- if (this.readyState !== WebSocket.OPEN) {
396
- sendAfterClose(this, data, cb);
397
- return;
398
- }
399
-
400
- if (mask === undefined) mask = !this._isServer;
401
- this._sender.ping(data || EMPTY_BUFFER, mask, cb);
402
- }
403
-
404
- /**
405
- * Send a pong.
406
- *
407
- * @param {*} [data] The data to send
408
- * @param {Boolean} [mask] Indicates whether or not to mask `data`
409
- * @param {Function} [cb] Callback which is executed when the pong is sent
410
- * @public
411
- */
412
- pong(data, mask, cb) {
413
- if (this.readyState === WebSocket.CONNECTING) {
414
- throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
415
- }
416
-
417
- if (typeof data === 'function') {
418
- cb = data;
419
- data = mask = undefined;
420
- } else if (typeof mask === 'function') {
421
- cb = mask;
422
- mask = undefined;
423
- }
424
-
425
- if (typeof data === 'number') data = data.toString();
426
-
427
- if (this.readyState !== WebSocket.OPEN) {
428
- sendAfterClose(this, data, cb);
429
- return;
430
- }
431
-
432
- if (mask === undefined) mask = !this._isServer;
433
- this._sender.pong(data || EMPTY_BUFFER, mask, cb);
434
- }
435
-
436
- /**
437
- * Resume the socket.
438
- *
439
- * @public
440
- */
441
- resume() {
442
- if (
443
- this.readyState === WebSocket.CONNECTING ||
444
- this.readyState === WebSocket.CLOSED
445
- ) {
446
- return;
447
- }
448
-
449
- this._paused = false;
450
- if (!this._receiver._writableState.needDrain) this._socket.resume();
451
- }
452
-
453
- /**
454
- * Send a data message.
455
- *
456
- * @param {*} data The message to send
457
- * @param {Object} [options] Options object
458
- * @param {Boolean} [options.binary] Specifies whether `data` is binary or
459
- * text
460
- * @param {Boolean} [options.compress] Specifies whether or not to compress
461
- * `data`
462
- * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
463
- * last one
464
- * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
465
- * @param {Function} [cb] Callback which is executed when data is written out
466
- * @public
467
- */
468
- send(data, options, cb) {
469
- if (this.readyState === WebSocket.CONNECTING) {
470
- throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
471
- }
472
-
473
- if (typeof options === 'function') {
474
- cb = options;
475
- options = {};
476
- }
477
-
478
- if (typeof data === 'number') data = data.toString();
479
-
480
- if (this.readyState !== WebSocket.OPEN) {
481
- sendAfterClose(this, data, cb);
482
- return;
483
- }
484
-
485
- const opts = {
486
- binary: typeof data !== 'string',
487
- mask: !this._isServer,
488
- compress: true,
489
- fin: true,
490
- ...options
491
- };
492
-
493
- if (!this._extensions[PerMessageDeflate.extensionName]) {
494
- opts.compress = false;
495
- }
496
-
497
- this._sender.send(data || EMPTY_BUFFER, opts, cb);
498
- }
499
-
500
- /**
501
- * Forcibly close the connection.
502
- *
503
- * @public
504
- */
505
- terminate() {
506
- if (this.readyState === WebSocket.CLOSED) return;
507
- if (this.readyState === WebSocket.CONNECTING) {
508
- const msg = 'WebSocket was closed before the connection was established';
509
- abortHandshake(this, this._req, msg);
510
- return;
511
- }
512
-
513
- if (this._socket) {
514
- this._readyState = WebSocket.CLOSING;
515
- this._socket.destroy();
516
- }
517
- }
518
- }
519
-
520
- /**
521
- * @constant {Number} CONNECTING
522
- * @memberof WebSocket
523
- */
524
- Object.defineProperty(WebSocket, 'CONNECTING', {
525
- enumerable: true,
526
- value: readyStates.indexOf('CONNECTING')
527
- });
528
-
529
- /**
530
- * @constant {Number} CONNECTING
531
- * @memberof WebSocket.prototype
532
- */
533
- Object.defineProperty(WebSocket.prototype, 'CONNECTING', {
534
- enumerable: true,
535
- value: readyStates.indexOf('CONNECTING')
536
- });
537
-
538
- /**
539
- * @constant {Number} OPEN
540
- * @memberof WebSocket
541
- */
542
- Object.defineProperty(WebSocket, 'OPEN', {
543
- enumerable: true,
544
- value: readyStates.indexOf('OPEN')
545
- });
546
-
547
- /**
548
- * @constant {Number} OPEN
549
- * @memberof WebSocket.prototype
550
- */
551
- Object.defineProperty(WebSocket.prototype, 'OPEN', {
552
- enumerable: true,
553
- value: readyStates.indexOf('OPEN')
554
- });
555
-
556
- /**
557
- * @constant {Number} CLOSING
558
- * @memberof WebSocket
559
- */
560
- Object.defineProperty(WebSocket, 'CLOSING', {
561
- enumerable: true,
562
- value: readyStates.indexOf('CLOSING')
563
- });
564
-
565
- /**
566
- * @constant {Number} CLOSING
567
- * @memberof WebSocket.prototype
568
- */
569
- Object.defineProperty(WebSocket.prototype, 'CLOSING', {
570
- enumerable: true,
571
- value: readyStates.indexOf('CLOSING')
572
- });
573
-
574
- /**
575
- * @constant {Number} CLOSED
576
- * @memberof WebSocket
577
- */
578
- Object.defineProperty(WebSocket, 'CLOSED', {
579
- enumerable: true,
580
- value: readyStates.indexOf('CLOSED')
581
- });
582
-
583
- /**
584
- * @constant {Number} CLOSED
585
- * @memberof WebSocket.prototype
586
- */
587
- Object.defineProperty(WebSocket.prototype, 'CLOSED', {
588
- enumerable: true,
589
- value: readyStates.indexOf('CLOSED')
590
- });
591
-
592
- [
593
- 'binaryType',
594
- 'bufferedAmount',
595
- 'extensions',
596
- 'isPaused',
597
- 'protocol',
598
- 'readyState',
599
- 'url'
600
- ].forEach((property) => {
601
- Object.defineProperty(WebSocket.prototype, property, { enumerable: true });
602
- });
603
-
604
- //
605
- // Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.
606
- // See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
607
- //
608
- ['open', 'error', 'close', 'message'].forEach((method) => {
609
- Object.defineProperty(WebSocket.prototype, `on${method}`, {
610
- enumerable: true,
611
- get() {
612
- for (const listener of this.listeners(method)) {
613
- if (listener[kForOnEventAttribute]) return listener[kListener];
614
- }
615
-
616
- return null;
617
- },
618
- set(handler) {
619
- for (const listener of this.listeners(method)) {
620
- if (listener[kForOnEventAttribute]) {
621
- this.removeListener(method, listener);
622
- break;
623
- }
624
- }
625
-
626
- if (typeof handler !== 'function') return;
627
-
628
- this.addEventListener(method, handler, {
629
- [kForOnEventAttribute]: true
630
- });
631
- }
632
- });
633
- });
634
-
635
- WebSocket.prototype.addEventListener = addEventListener;
636
- WebSocket.prototype.removeEventListener = removeEventListener;
637
-
638
- websocket = WebSocket;
639
-
640
- /**
641
- * Initialize a WebSocket client.
642
- *
643
- * @param {WebSocket} websocket The client to initialize
644
- * @param {(String|URL)} address The URL to which to connect
645
- * @param {Array} protocols The subprotocols
646
- * @param {Object} [options] Connection options
647
- * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether any
648
- * of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple
649
- * times in the same tick
650
- * @param {Boolean} [options.autoPong=true] Specifies whether or not to
651
- * automatically send a pong in response to a ping
652
- * @param {Function} [options.finishRequest] A function which can be used to
653
- * customize the headers of each http request before it is sent
654
- * @param {Boolean} [options.followRedirects=false] Whether or not to follow
655
- * redirects
656
- * @param {Function} [options.generateMask] The function used to generate the
657
- * masking key
658
- * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
659
- * handshake request
660
- * @param {Number} [options.maxPayload=104857600] The maximum allowed message
661
- * size
662
- * @param {Number} [options.maxRedirects=10] The maximum number of redirects
663
- * allowed
664
- * @param {String} [options.origin] Value of the `Origin` or
665
- * `Sec-WebSocket-Origin` header
666
- * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable
667
- * permessage-deflate
668
- * @param {Number} [options.protocolVersion=13] Value of the
669
- * `Sec-WebSocket-Version` header
670
- * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
671
- * not to skip UTF-8 validation for text and close messages
672
- * @private
673
- */
674
- function initAsClient(websocket, address, protocols, options) {
675
- const opts = {
676
- allowSynchronousEvents: true,
677
- autoPong: true,
678
- protocolVersion: protocolVersions[1],
679
- maxPayload: 100 * 1024 * 1024,
680
- skipUTF8Validation: false,
681
- perMessageDeflate: true,
682
- followRedirects: false,
683
- maxRedirects: 10,
684
- ...options,
685
- socketPath: undefined,
686
- hostname: undefined,
687
- protocol: undefined,
688
- timeout: undefined,
689
- method: 'GET',
690
- host: undefined,
691
- path: undefined,
692
- port: undefined
693
- };
694
-
695
- websocket._autoPong = opts.autoPong;
696
-
697
- if (!protocolVersions.includes(opts.protocolVersion)) {
698
- throw new RangeError(
699
- `Unsupported protocol version: ${opts.protocolVersion} ` +
700
- `(supported versions: ${protocolVersions.join(', ')})`
701
- );
702
- }
703
-
704
- let parsedUrl;
705
-
706
- if (address instanceof URL) {
707
- parsedUrl = address;
708
- } else {
709
- try {
710
- parsedUrl = new URL(address);
711
- } catch (e) {
712
- throw new SyntaxError(`Invalid URL: ${address}`);
713
- }
714
- }
715
-
716
- if (parsedUrl.protocol === 'http:') {
717
- parsedUrl.protocol = 'ws:';
718
- } else if (parsedUrl.protocol === 'https:') {
719
- parsedUrl.protocol = 'wss:';
720
- }
721
-
722
- websocket._url = parsedUrl.href;
723
-
724
- const isSecure = parsedUrl.protocol === 'wss:';
725
- const isIpcUrl = parsedUrl.protocol === 'ws+unix:';
726
- let invalidUrlMessage;
727
-
728
- if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {
729
- invalidUrlMessage =
730
- 'The URL\'s protocol must be one of "ws:", "wss:", ' +
731
- '"http:", "https", or "ws+unix:"';
732
- } else if (isIpcUrl && !parsedUrl.pathname) {
733
- invalidUrlMessage = "The URL's pathname is empty";
734
- } else if (parsedUrl.hash) {
735
- invalidUrlMessage = 'The URL contains a fragment identifier';
736
- }
737
-
738
- if (invalidUrlMessage) {
739
- const err = new SyntaxError(invalidUrlMessage);
740
-
741
- if (websocket._redirects === 0) {
742
- throw err;
743
- } else {
744
- emitErrorAndClose(websocket, err);
745
- return;
746
- }
747
- }
748
-
749
- const defaultPort = isSecure ? 443 : 80;
750
- const key = randomBytes(16).toString('base64');
751
- const request = isSecure ? https.request : http.request;
752
- const protocolSet = new Set();
753
- let perMessageDeflate;
754
-
755
- opts.createConnection =
756
- opts.createConnection || (isSecure ? tlsConnect : netConnect);
757
- opts.defaultPort = opts.defaultPort || defaultPort;
758
- opts.port = parsedUrl.port || defaultPort;
759
- opts.host = parsedUrl.hostname.startsWith('[')
760
- ? parsedUrl.hostname.slice(1, -1)
761
- : parsedUrl.hostname;
762
- opts.headers = {
763
- ...opts.headers,
764
- 'Sec-WebSocket-Version': opts.protocolVersion,
765
- 'Sec-WebSocket-Key': key,
766
- Connection: 'Upgrade',
767
- Upgrade: 'websocket'
768
- };
769
- opts.path = parsedUrl.pathname + parsedUrl.search;
770
- opts.timeout = opts.handshakeTimeout;
771
-
772
- if (opts.perMessageDeflate) {
773
- perMessageDeflate = new PerMessageDeflate(
774
- opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
775
- false,
776
- opts.maxPayload
777
- );
778
- opts.headers['Sec-WebSocket-Extensions'] = format({
779
- [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
780
- });
781
- }
782
- if (protocols.length) {
783
- for (const protocol of protocols) {
784
- if (
785
- typeof protocol !== 'string' ||
786
- !subprotocolRegex.test(protocol) ||
787
- protocolSet.has(protocol)
788
- ) {
789
- throw new SyntaxError(
790
- 'An invalid or duplicated subprotocol was specified'
791
- );
792
- }
793
-
794
- protocolSet.add(protocol);
795
- }
796
-
797
- opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');
798
- }
799
- if (opts.origin) {
800
- if (opts.protocolVersion < 13) {
801
- opts.headers['Sec-WebSocket-Origin'] = opts.origin;
802
- } else {
803
- opts.headers.Origin = opts.origin;
804
- }
805
- }
806
- if (parsedUrl.username || parsedUrl.password) {
807
- opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
808
- }
809
-
810
- if (isIpcUrl) {
811
- const parts = opts.path.split(':');
812
-
813
- opts.socketPath = parts[0];
814
- opts.path = parts[1];
815
- }
816
-
817
- let req;
818
-
819
- if (opts.followRedirects) {
820
- if (websocket._redirects === 0) {
821
- websocket._originalIpc = isIpcUrl;
822
- websocket._originalSecure = isSecure;
823
- websocket._originalHostOrSocketPath = isIpcUrl
824
- ? opts.socketPath
825
- : parsedUrl.host;
826
-
827
- const headers = options && options.headers;
828
-
829
- //
830
- // Shallow copy the user provided options so that headers can be changed
831
- // without mutating the original object.
832
- //
833
- options = { ...options, headers: {} };
834
-
835
- if (headers) {
836
- for (const [key, value] of Object.entries(headers)) {
837
- options.headers[key.toLowerCase()] = value;
838
- }
839
- }
840
- } else if (websocket.listenerCount('redirect') === 0) {
841
- const isSameHost = isIpcUrl
842
- ? websocket._originalIpc
843
- ? opts.socketPath === websocket._originalHostOrSocketPath
844
- : false
845
- : websocket._originalIpc
846
- ? false
847
- : parsedUrl.host === websocket._originalHostOrSocketPath;
848
-
849
- if (!isSameHost || (websocket._originalSecure && !isSecure)) {
850
- //
851
- // Match curl 7.77.0 behavior and drop the following headers. These
852
- // headers are also dropped when following a redirect to a subdomain.
853
- //
854
- delete opts.headers.authorization;
855
- delete opts.headers.cookie;
856
-
857
- if (!isSameHost) delete opts.headers.host;
858
-
859
- opts.auth = undefined;
860
- }
861
- }
862
-
863
- //
864
- // Match curl 7.77.0 behavior and make the first `Authorization` header win.
865
- // If the `Authorization` header is set, then there is nothing to do as it
866
- // will take precedence.
867
- //
868
- if (opts.auth && !options.headers.authorization) {
869
- options.headers.authorization =
870
- 'Basic ' + Buffer.from(opts.auth).toString('base64');
871
- }
872
-
873
- req = websocket._req = request(opts);
874
-
875
- if (websocket._redirects) {
876
- //
877
- // Unlike what is done for the `'upgrade'` event, no early exit is
878
- // triggered here if the user calls `websocket.close()` or
879
- // `websocket.terminate()` from a listener of the `'redirect'` event. This
880
- // is because the user can also call `request.destroy()` with an error
881
- // before calling `websocket.close()` or `websocket.terminate()` and this
882
- // would result in an error being emitted on the `request` object with no
883
- // `'error'` event listeners attached.
884
- //
885
- websocket.emit('redirect', websocket.url, req);
886
- }
887
- } else {
888
- req = websocket._req = request(opts);
889
- }
890
-
891
- if (opts.timeout) {
892
- req.on('timeout', () => {
893
- abortHandshake(websocket, req, 'Opening handshake has timed out');
894
- });
895
- }
896
-
897
- req.on('error', (err) => {
898
- if (req === null || req[kAborted]) return;
899
-
900
- req = websocket._req = null;
901
- emitErrorAndClose(websocket, err);
902
- });
903
-
904
- req.on('response', (res) => {
905
- const location = res.headers.location;
906
- const statusCode = res.statusCode;
907
-
908
- if (
909
- location &&
910
- opts.followRedirects &&
911
- statusCode >= 300 &&
912
- statusCode < 400
913
- ) {
914
- if (++websocket._redirects > opts.maxRedirects) {
915
- abortHandshake(websocket, req, 'Maximum redirects exceeded');
916
- return;
917
- }
918
-
919
- req.abort();
920
-
921
- let addr;
922
-
923
- try {
924
- addr = new URL(location, address);
925
- } catch (e) {
926
- const err = new SyntaxError(`Invalid URL: ${location}`);
927
- emitErrorAndClose(websocket, err);
928
- return;
929
- }
930
-
931
- initAsClient(websocket, addr, protocols, options);
932
- } else if (!websocket.emit('unexpected-response', req, res)) {
933
- abortHandshake(
934
- websocket,
935
- req,
936
- `Unexpected server response: ${res.statusCode}`
937
- );
938
- }
939
- });
940
-
941
- req.on('upgrade', (res, socket, head) => {
942
- websocket.emit('upgrade', res);
943
-
944
- //
945
- // The user may have closed the connection from a listener of the
946
- // `'upgrade'` event.
947
- //
948
- if (websocket.readyState !== WebSocket.CONNECTING) return;
949
-
950
- req = websocket._req = null;
951
-
952
- const upgrade = res.headers.upgrade;
953
-
954
- if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {
955
- abortHandshake(websocket, socket, 'Invalid Upgrade header');
956
- return;
957
- }
958
-
959
- const digest = createHash('sha1')
960
- .update(key + GUID)
961
- .digest('base64');
962
-
963
- if (res.headers['sec-websocket-accept'] !== digest) {
964
- abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');
965
- return;
966
- }
967
-
968
- const serverProt = res.headers['sec-websocket-protocol'];
969
- let protError;
970
-
971
- if (serverProt !== undefined) {
972
- if (!protocolSet.size) {
973
- protError = 'Server sent a subprotocol but none was requested';
974
- } else if (!protocolSet.has(serverProt)) {
975
- protError = 'Server sent an invalid subprotocol';
976
- }
977
- } else if (protocolSet.size) {
978
- protError = 'Server sent no subprotocol';
979
- }
980
-
981
- if (protError) {
982
- abortHandshake(websocket, socket, protError);
983
- return;
984
- }
985
-
986
- if (serverProt) websocket._protocol = serverProt;
987
-
988
- const secWebSocketExtensions = res.headers['sec-websocket-extensions'];
989
-
990
- if (secWebSocketExtensions !== undefined) {
991
- if (!perMessageDeflate) {
992
- const message =
993
- 'Server sent a Sec-WebSocket-Extensions header but no extension ' +
994
- 'was requested';
995
- abortHandshake(websocket, socket, message);
996
- return;
997
- }
998
-
999
- let extensions;
1000
-
1001
- try {
1002
- extensions = parse(secWebSocketExtensions);
1003
- } catch (err) {
1004
- const message = 'Invalid Sec-WebSocket-Extensions header';
1005
- abortHandshake(websocket, socket, message);
1006
- return;
1007
- }
1008
-
1009
- const extensionNames = Object.keys(extensions);
1010
-
1011
- if (
1012
- extensionNames.length !== 1 ||
1013
- extensionNames[0] !== PerMessageDeflate.extensionName
1014
- ) {
1015
- const message = 'Server indicated an extension that was not requested';
1016
- abortHandshake(websocket, socket, message);
1017
- return;
1018
- }
1019
-
1020
- try {
1021
- perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);
1022
- } catch (err) {
1023
- const message = 'Invalid Sec-WebSocket-Extensions header';
1024
- abortHandshake(websocket, socket, message);
1025
- return;
1026
- }
1027
-
1028
- websocket._extensions[PerMessageDeflate.extensionName] =
1029
- perMessageDeflate;
1030
- }
1031
-
1032
- websocket.setSocket(socket, head, {
1033
- allowSynchronousEvents: opts.allowSynchronousEvents,
1034
- generateMask: opts.generateMask,
1035
- maxPayload: opts.maxPayload,
1036
- skipUTF8Validation: opts.skipUTF8Validation
1037
- });
1038
- });
1039
-
1040
- if (opts.finishRequest) {
1041
- opts.finishRequest(req, websocket);
1042
- } else {
1043
- req.end();
1044
- }
1045
- }
1046
-
1047
- /**
1048
- * Emit the `'error'` and `'close'` events.
1049
- *
1050
- * @param {WebSocket} websocket The WebSocket instance
1051
- * @param {Error} The error to emit
1052
- * @private
1053
- */
1054
- function emitErrorAndClose(websocket, err) {
1055
- websocket._readyState = WebSocket.CLOSING;
1056
- websocket.emit('error', err);
1057
- websocket.emitClose();
1058
- }
1059
-
1060
- /**
1061
- * Create a `net.Socket` and initiate a connection.
1062
- *
1063
- * @param {Object} options Connection options
1064
- * @return {net.Socket} The newly created socket used to start the connection
1065
- * @private
1066
- */
1067
- function netConnect(options) {
1068
- options.path = options.socketPath;
1069
- return net.connect(options);
1070
- }
1071
-
1072
- /**
1073
- * Create a `tls.TLSSocket` and initiate a connection.
1074
- *
1075
- * @param {Object} options Connection options
1076
- * @return {tls.TLSSocket} The newly created socket used to start the connection
1077
- * @private
1078
- */
1079
- function tlsConnect(options) {
1080
- options.path = undefined;
1081
-
1082
- if (!options.servername && options.servername !== '') {
1083
- options.servername = net.isIP(options.host) ? '' : options.host;
1084
- }
1085
-
1086
- return tls.connect(options);
1087
- }
1088
-
1089
- /**
1090
- * Abort the handshake and emit an error.
1091
- *
1092
- * @param {WebSocket} websocket The WebSocket instance
1093
- * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to
1094
- * abort or the socket to destroy
1095
- * @param {String} message The error message
1096
- * @private
1097
- */
1098
- function abortHandshake(websocket, stream, message) {
1099
- websocket._readyState = WebSocket.CLOSING;
1100
-
1101
- const err = new Error(message);
1102
- Error.captureStackTrace(err, abortHandshake);
1103
-
1104
- if (stream.setHeader) {
1105
- stream[kAborted] = true;
1106
- stream.abort();
1107
-
1108
- if (stream.socket && !stream.socket.destroyed) {
1109
- //
1110
- // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if
1111
- // called after the request completed. See
1112
- // https://github.com/websockets/ws/issues/1869.
1113
- //
1114
- stream.socket.destroy();
1115
- }
1116
-
1117
- process.nextTick(emitErrorAndClose, websocket, err);
1118
- } else {
1119
- stream.destroy(err);
1120
- stream.once('error', websocket.emit.bind(websocket, 'error'));
1121
- stream.once('close', websocket.emitClose.bind(websocket));
1122
- }
1123
- }
1124
-
1125
- /**
1126
- * Handle cases where the `ping()`, `pong()`, or `send()` methods are called
1127
- * when the `readyState` attribute is `CLOSING` or `CLOSED`.
1128
- *
1129
- * @param {WebSocket} websocket The WebSocket instance
1130
- * @param {*} [data] The data to send
1131
- * @param {Function} [cb] Callback
1132
- * @private
1133
- */
1134
- function sendAfterClose(websocket, data, cb) {
1135
- if (data) {
1136
- const length = toBuffer(data).length;
1137
-
1138
- //
1139
- // The `_bufferedAmount` property is used only when the peer is a client and
1140
- // the opening handshake fails. Under these circumstances, in fact, the
1141
- // `setSocket()` method is not called, so the `_socket` and `_sender`
1142
- // properties are set to `null`.
1143
- //
1144
- if (websocket._socket) websocket._sender._bufferedBytes += length;
1145
- else websocket._bufferedAmount += length;
1146
- }
1147
-
1148
- if (cb) {
1149
- const err = new Error(
1150
- `WebSocket is not open: readyState ${websocket.readyState} ` +
1151
- `(${readyStates[websocket.readyState]})`
1152
- );
1153
- process.nextTick(cb, err);
1154
- }
1155
- }
1156
-
1157
- /**
1158
- * The listener of the `Receiver` `'conclude'` event.
1159
- *
1160
- * @param {Number} code The status code
1161
- * @param {Buffer} reason The reason for closing
1162
- * @private
1163
- */
1164
- function receiverOnConclude(code, reason) {
1165
- const websocket = this[kWebSocket];
1166
-
1167
- websocket._closeFrameReceived = true;
1168
- websocket._closeMessage = reason;
1169
- websocket._closeCode = code;
1170
-
1171
- if (websocket._socket[kWebSocket] === undefined) return;
1172
-
1173
- websocket._socket.removeListener('data', socketOnData);
1174
- process.nextTick(resume, websocket._socket);
1175
-
1176
- if (code === 1005) websocket.close();
1177
- else websocket.close(code, reason);
1178
- }
1179
-
1180
- /**
1181
- * The listener of the `Receiver` `'drain'` event.
1182
- *
1183
- * @private
1184
- */
1185
- function receiverOnDrain() {
1186
- const websocket = this[kWebSocket];
1187
-
1188
- if (!websocket.isPaused) websocket._socket.resume();
1189
- }
1190
-
1191
- /**
1192
- * The listener of the `Receiver` `'error'` event.
1193
- *
1194
- * @param {(RangeError|Error)} err The emitted error
1195
- * @private
1196
- */
1197
- function receiverOnError(err) {
1198
- const websocket = this[kWebSocket];
1199
-
1200
- if (websocket._socket[kWebSocket] !== undefined) {
1201
- websocket._socket.removeListener('data', socketOnData);
1202
-
1203
- //
1204
- // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See
1205
- // https://github.com/websockets/ws/issues/1940.
1206
- //
1207
- process.nextTick(resume, websocket._socket);
1208
-
1209
- websocket.close(err[kStatusCode]);
1210
- }
1211
-
1212
- websocket.emit('error', err);
1213
- }
1214
-
1215
- /**
1216
- * The listener of the `Receiver` `'finish'` event.
1217
- *
1218
- * @private
1219
- */
1220
- function receiverOnFinish() {
1221
- this[kWebSocket].emitClose();
1222
- }
1223
-
1224
- /**
1225
- * The listener of the `Receiver` `'message'` event.
1226
- *
1227
- * @param {Buffer|ArrayBuffer|Buffer[])} data The message
1228
- * @param {Boolean} isBinary Specifies whether the message is binary or not
1229
- * @private
1230
- */
1231
- function receiverOnMessage(data, isBinary) {
1232
- this[kWebSocket].emit('message', data, isBinary);
1233
- }
1234
-
1235
- /**
1236
- * The listener of the `Receiver` `'ping'` event.
1237
- *
1238
- * @param {Buffer} data The data included in the ping frame
1239
- * @private
1240
- */
1241
- function receiverOnPing(data) {
1242
- const websocket = this[kWebSocket];
1243
-
1244
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
1245
- websocket.emit('ping', data);
1246
- }
1247
-
1248
- /**
1249
- * The listener of the `Receiver` `'pong'` event.
1250
- *
1251
- * @param {Buffer} data The data included in the pong frame
1252
- * @private
1253
- */
1254
- function receiverOnPong(data) {
1255
- this[kWebSocket].emit('pong', data);
1256
- }
1257
-
1258
- /**
1259
- * Resume a readable stream
1260
- *
1261
- * @param {Readable} stream The readable stream
1262
- * @private
1263
- */
1264
- function resume(stream) {
1265
- stream.resume();
1266
- }
1267
-
1268
- /**
1269
- * The listener of the socket `'close'` event.
1270
- *
1271
- * @private
1272
- */
1273
- function socketOnClose() {
1274
- const websocket = this[kWebSocket];
1275
-
1276
- this.removeListener('close', socketOnClose);
1277
- this.removeListener('data', socketOnData);
1278
- this.removeListener('end', socketOnEnd);
1279
-
1280
- websocket._readyState = WebSocket.CLOSING;
1281
-
1282
- let chunk;
1283
-
1284
- //
1285
- // The close frame might not have been received or the `'end'` event emitted,
1286
- // for example, if the socket was destroyed due to an error. Ensure that the
1287
- // `receiver` stream is closed after writing any remaining buffered data to
1288
- // it. If the readable side of the socket is in flowing mode then there is no
1289
- // buffered data as everything has been already written and `readable.read()`
1290
- // will return `null`. If instead, the socket is paused, any possible buffered
1291
- // data will be read as a single chunk.
1292
- //
1293
- if (
1294
- !this._readableState.endEmitted &&
1295
- !websocket._closeFrameReceived &&
1296
- !websocket._receiver._writableState.errorEmitted &&
1297
- (chunk = websocket._socket.read()) !== null
1298
- ) {
1299
- websocket._receiver.write(chunk);
1300
- }
1301
-
1302
- websocket._receiver.end();
1303
-
1304
- this[kWebSocket] = undefined;
1305
-
1306
- clearTimeout(websocket._closeTimer);
1307
-
1308
- if (
1309
- websocket._receiver._writableState.finished ||
1310
- websocket._receiver._writableState.errorEmitted
1311
- ) {
1312
- websocket.emitClose();
1313
- } else {
1314
- websocket._receiver.on('error', receiverOnFinish);
1315
- websocket._receiver.on('finish', receiverOnFinish);
1316
- }
1317
- }
1318
-
1319
- /**
1320
- * The listener of the socket `'data'` event.
1321
- *
1322
- * @param {Buffer} chunk A chunk of data
1323
- * @private
1324
- */
1325
- function socketOnData(chunk) {
1326
- if (!this[kWebSocket]._receiver.write(chunk)) {
1327
- this.pause();
1328
- }
1329
- }
1330
-
1331
- /**
1332
- * The listener of the socket `'end'` event.
1333
- *
1334
- * @private
1335
- */
1336
- function socketOnEnd() {
1337
- const websocket = this[kWebSocket];
1338
-
1339
- websocket._readyState = WebSocket.CLOSING;
1340
- websocket._receiver.end();
1341
- this.end();
1342
- }
1343
-
1344
- /**
1345
- * The listener of the socket `'error'` event.
1346
- *
1347
- * @private
1348
- */
1349
- function socketOnError() {
1350
- const websocket = this[kWebSocket];
1351
-
1352
- this.removeListener('error', socketOnError);
1353
- this.on('error', NOOP);
1354
-
1355
- if (websocket) {
1356
- websocket._readyState = WebSocket.CLOSING;
1357
- this.destroy();
1358
- }
1359
- }
1360
- return websocket;
1361
- }
1362
-
1363
- export { requireWebsocket as __require };