netty-demo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

275 lines
12 KiB

9 years ago
13 years ago
12 years ago
11 years ago
12 years ago
11 years ago
12 years ago
4 years ago
12 years ago
11 years ago
12 years ago
13 years ago
12 years ago
11 years ago
12 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
4 years ago
5 years ago
6 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
9 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
4 years ago
11 years ago
10 years ago
  1. Netty-socketio Overview
  2. ===
  3. This project is an open-source Java implementation of [Socket.IO](http://socket.io/) server. Based on [Netty](http://netty.io/) server framework.
  4. Checkout [Demo project](https://github.com/mrniko/netty-socketio-demo)
  5. Licensed under the Apache License 2.0.
  6. Features
  7. ================================
  8. * Supports __0.7__...__0.9.16__ (netty-socketio 1.6.6) and __1.0+__ (netty-socketio latest version) version of [Socket.IO-client](https://github.com/LearnBoost/socket.io-client)
  9. * Supports xhr-polling transport
  10. * Supports websocket transport
  11. * Supports namespaces and rooms
  12. * Supports ack (acknowledgment of received data)
  13. * Supports SSL
  14. * Supports client store (Memory, [Redisson](https://redisson.org), [Hazelcast](https://www.hazelcast.com/))
  15. * Supports distributed broadcast across netty-socketio nodes ([Redisson](https://redisson.org), [Hazelcast](https://www.hazelcast.com/))
  16. * Supports OSGi
  17. * Supports Spring
  18. * Lock-free and thread-safe implementation
  19. * Declarative handler configuration via annotations
  20. Performance
  21. ================================
  22. Customer feedback in __2012__:
  23. CentOS, 1 CPU, 4GB RAM runned on VM:
  24. CPU 10%, Memory 15%
  25. 6000 xhr-long polling sessions or 15000 websockets sessions
  26. 4000 messages per second
  27. Customer feedback in __2014__:
  28. "To stress test the solution we run 30 000 simultaneous websocket clients and managed to peak at total of about 140 000 messages per second with less than 1 second average delay." (c) Viktor Endersz - Kambi Sports Solutions
  29. Projects using netty-socketio
  30. ================================
  31. AVOS Cloud: [avoscloud.com](https://avoscloud.com/)
  32. Bingo Crack: [bingocrack.com](http://bingocrack.com/)
  33. Kambi Sports Solutions: [kambi.com](http://kambi.com/)
  34. ARSnova: [arsnova.eu](https://arsnova.eu)
  35. Zipwhip: [zipwhip.com](https://zipwhip.com/)
  36. Recent Releases
  37. ================================
  38. #### Please Note: trunk is current development branch.
  39. #### 29-Apr-2021 - version 1.7.19 released
  40. #### 17-Jan-2020 - version 1.7.18 released
  41. Feature - support for event interceptors which catch all events (thanks to yosiat)
  42. Fixed - namespace event broadcasting (thanks to Volodymyr Masliy)
  43. #### 11-Jan-2019 - version 1.7.17 released
  44. Feature - randomSession setting added to Config object (thanks to yuanxiangz)
  45. Fixed - NPE in WebSocketTransport
  46. Fixed - NPE & memory leak (thanks to zhaolianwang)
  47. Fixed - namespace parsing (thanks to Redliver)
  48. Fixed - Redisson 3.9+ compatibility
  49. #### 06-Jul-2018 - version 1.7.16 released
  50. Fixed - non thread-safe ACK handling (thanks to dawnbreaks)
  51. Fixed - inactive long-polling channels cause memory leak (thanks to dawnbreaks)
  52. Fixed - websocket CloseFrame processing (thanks to hangsu.cho)
  53. Fixed - WebSocketTransport NPE
  54. #### 15-May-2018 - version 1.7.15 released
  55. Fixed - Session ID is not unique anymore
  56. Fixed - fixed underlying connection not closing on ping timeout
  57. Fixed - the "fin_close" problem
  58. #### 26-Feb-2018 - version 1.7.14 released
  59. Feature - added local socket address for the connection (thanks to @SergeyGrigorev)
  60. Feature - `addPingListener` method added (thanks to @lovebing)
  61. Feature - add ThreadFactory for HashedWheelTimer (thanks to @hand515)
  62. Fixed - changed SO_LINGER to be handled as child channel (not server channel) option (thanks to @robymus)
  63. Fixed - ByteBuf leak if binary attachments are used
  64. Fixed - restore session from Cookie (thanks to @wuxudong)
  65. Fixed - NumberFormatException when b64 is bool value (thanks to @vonway)
  66. Fixed - data encoding for polling transport
  67. #### 20-Sep-2017 - version 1.7.13 released
  68. Feature - Added option to change the SSL KeyFactoryAlgorithm using Configuration (thanks to @robymus)
  69. Improvement - Binary ack handling improvements (thanks to Sergey Bushik)
  70. Fixed - Failed to mark a promise as success because it has succeeded already (thanks to @robymus)
  71. #### 27-Aug-2016 - version 1.7.12 released
  72. Feature - `SocketIOServer.removeAllListeners` method added
  73. Feature - `BroadcastOperations.sendEvent` method with `excludedClient` param added
  74. Improvement - Redisson updated to 2.4.0
  75. Fixed - memory leak in Namespace object (thanks to @CrazyIvan007)
  76. #### 13-Jul-2016 - version 1.7.11 released
  77. Fixed - Throw error if transport not supported
  78. Fixed - Client disconnecting when using Polling - IndexOutOfBoundsException
  79. #### 4-Mar-2016 - version 1.7.10 released
  80. Fixed - netty updated to 4.1.0.CR3 version
  81. Fixed - binary packet parsing (thanks to Winston Li)
  82. #### 6-Feb-2016 - version 1.7.9 released
  83. Feature - Compression support
  84. Fixed - DotNET client request handling
  85. Fixed - Packet length format parsing
  86. Fixed - skipping 'd=' in packet
  87. Fixed - Polling clients sporadically get prematurely disconnected (thanks to lpage30)
  88. Fixed - connections stay open forever if server sent `close` packet
  89. Fixed - compatibility with Redisson latest version
  90. #### 30-Nov-2015 - version 1.7.8 released
  91. Improvement - `WebSocketServerHandshaker.allowExtensions` is `true` now
  92. Improvement - SessionID cookie implementation (thanks to @ryandietrich)
  93. Fixed - clientRooms leak (thanks to @andreaspalm)
  94. Fixed - ExceptionListener not used for errors in JSON parsing
  95. Fixed - "silent channel" attack
  96. #### 26-Mar-2015 - version 1.6.7 released
  97. Improvement - `useStrictOrdering` param added for websocket packets strict ordering
  98. Improvement - `FAIL_ON_EMPTY_BEANS = false` option setted in json decoder
  99. #### 18-Feb-2015 - version 1.7.7 released
  100. Improvement - no need to add jackson lib if you use own JsonSupport impl
  101. Fixed - SocketIO client 1.3.x support
  102. Fixed - Charset encoding handling (thanks to alim-akbashev)
  103. #### 17-Jan-2015 - version 1.7.6 released
  104. Improvement - `SocketIONamespace.getName()` added
  105. Fixed - WebSocket frames aggregation
  106. Fixed - WebSocket buffer release
  107. Fixed - `Unexpected end-of-input in VALUE_STRING` error
  108. Fixed - Access-Control-Allow-Credentials is TRUE for requests with origin header
  109. #### 05-Dec-2014 - version 1.7.5 released
  110. Feature - `Configuration.sslProtocol` param added
  111. Fixed - BinaryEvent ack handling
  112. Fixed - BinaryEvent non b64 encoding/decoding
  113. Fixed - buffer leak during packet encoding
  114. #### 15-Nov-2014 - version 1.7.4 released
  115. Fixed - packet encoding
  116. Fixed - BinaryEvent encoding/decoding
  117. Fixed - unchallenged connections handling
  118. #### 29-Sep-2014 - version 1.6.6 released
  119. Feature - `origin` setting added
  120. Feature - `crossDomainPolicy` setting added
  121. Feature - `SocketIOServer.startAsync` method added
  122. #### 24-Sep-2014 - version 1.7.3 released
  123. Feature - Epoll support
  124. Improvement - BinaryEvent support
  125. Fixed - SocketIOClient disconnect handling
  126. Fixed - broadcast callback
  127. Fixed - NPE then no transport defined during auth
  128. Fixed - ping timeout for polling transport
  129. Fixed - buffer leak in PacketEncoder
  130. #### 22-Aug-2014 - version 1.7.2 released
  131. Fixed - wrong outgoing message encoding using websocket transport
  132. Fixed - NPE in websocket transport
  133. Fixed - multiple packet decoding in polling transport
  134. Fixed - buffer leak
  135. #### 07-Jul-2014 - version 1.7.1 released
  136. Feature - ability to set custom `Access-Control-Allow-Origin` via Configuration.origin
  137. Fixed - connection via CLI socket.io-client
  138. #### 28-Jun-2014 - version 1.7.0 released
  139. Feature - Socket.IO 1.0 protocol support. Thanks to the new protocol decoding/encoding has speedup
  140. __Dropped__ - `SocketIOClient.sendMessage`, `SocketIOClient.sendJsonObject` methods and corresponding listeners
  141. __Dropped__ - Flashsocket transport support
  142. __Dropped__ - protocol version 0.7 ... 0.9.16
  143. #### 13-May-2014 - version 1.6.5 released
  144. Improvement - single packet encoding optimized, used mostly in WebSocket transport. Encoding time reduced up to 40% (thanks to Viktor Endersz)
  145. Improvement - rooms handling optimized
  146. Improvement - ExceptionListener.exceptionCaught method added
  147. __Breaking api change__ - Configuration.autoAck replaced with ackMode
  148. Feature - trustStore setting added
  149. Feature - maxFramePayloadLength setting added
  150. Feature - getAllClients and getClient methods added to SocketIONamespace
  151. Fixed - SocketIOServer.getAllClients returns wrong clients amount
  152. #### 25-Mar-2014 - version 1.6.4 released
  153. Fixed - message release problem
  154. Fixed - problem with exception listener configuration redefinition
  155. __Breaking api change__ - DataListener.onData now throws Exception
  156. Improvement - data parameter added to exception listener
  157. Improvement - ability to setup socket configuration
  158. Improvement - Configuration.autoAck parameter added
  159. #### 06-Mar-2014 - version 1.6.3 released
  160. Fixed - AckCallback handling during client disconnect
  161. Fixed - unauthorized handshake HTTP code changed to 401
  162. __Breaking api change__ - Configuration.heartbeatThreadPoolSize setting removed
  163. Feature - annotated Spring beans support via _SpringAnnotationScanner_
  164. Feature - common exception listener
  165. Improvement - _ScheduledExecutorService_ replaced with _HashedWheelTimer_
  166. #### 08-Feb-2014 - version 1.6.2 released
  167. Fixed - wrong namespace client disconnect handling
  168. Fixed - exception in onConnect/onDisconnect/isAuthorized methods leads to server hang
  169. __Breaking api change__ - SocketIOClient.sendEvent methods signature changed
  170. Improvement - multi type events support via _MultiTypeEventListener_ and _OnEvent_ annotation
  171. Improvement - multi type events ack support via _MultiTypeAckCallback_
  172. Improvement - SocketIOClient.getHandshakeData method added
  173. Improvement - Jedis replaced with [Redisson](https://github.com/mrniko/redisson)
  174. #### 14-Jan-2014 - version 1.6.1 released
  175. Fixed - JDK 1.6+ compatibility
  176. Feature - authorization support
  177. #### 19-Dec-2013 - version 1.6.0 released
  178. Fixed - XHR-pooling transport regression
  179. Fixed - Websocket transport regression
  180. Fixed - namespace NPE in PacketHandler
  181. Fixed - executors shutdown during server stop
  182. Feature - client store (Memory, [Redis](http://redis.io/), [Hazelcast](http://www.hazelcast.com/)) support
  183. Feature - distributed broadcast across netty-socketio nodes ([Redis](http://redis.io/), [Hazelcast](http://www.hazelcast.com/)) support
  184. Feature - OSGi support (thanks to rdevera)
  185. Improvement - XHR-pooling optimization
  186. Improvement - SocketIOClient.getAllRooms method added
  187. #### 07-Dec-2013 - version 1.5.4 released
  188. Fixed - flash policy "request leak" after page reload (thanks to ntrp)
  189. Fixed - websocket swf loading (thanks to ntrp)
  190. Fixed - wrong urls causes a potential DDoS
  191. Fixed - Event.class package visibility changed to avoid direct usage
  192. Improvement - Simplified Jackson modules registration
  193. #### 24-Oct-2013 - version 1.5.2 released
  194. Fixed - NPE during shutdown
  195. Improvement - isEmpty method added to Namespace
  196. #### 13-Oct-2013 - version 1.5.1 released
  197. Fixed - wrong ack timeout callback invocation
  198. Fixed - bigdecimal serialization for JSON
  199. Fixed - infinity loop during packet handling exception
  200. Fixed - 'client not found' handling
  201. #### 27-Aug-2013 - version 1.5.0 released
  202. Improvement - encoding buffers allocation optimization.
  203. Improvement - encoding buffers now pooled in memory to reduce GC pressure (netty 4.x feature).
  204. #### 03-Aug-2013 - version 1.0.1 released
  205. Fixed - error on unknown property during deserialization.
  206. Fixed - memory leak in long polling transport.
  207. Improvement - logging error info with inbound data.
  208. #### 07-Jun-2013 - version 1.0.0 released
  209. First stable release.
  210. ### Maven
  211. Include the following to your dependency list:
  212. <dependency>
  213. <groupId>com.corundumstudio.socketio</groupId>
  214. <artifactId>netty-socketio</artifactId>
  215. <version>1.7.19</version>
  216. </dependency>
  217. ### Supported by
  218. YourKit is kindly supporting this open source project with its full-featured Java Profiler.
  219. YourKit, LLC is the creator of innovative and intelligent tools for profiling
  220. Java and .NET applications. Take a look at YourKit's leading software products:
  221. <a href="http://www.yourkit.com/java/profiler/index.jsp">YourKit Java Profiler</a> and
  222. <a href="http://www.yourkit.com/.net/profiler/index.jsp">YourKit .NET Profiler</a>.