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.

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