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.

262 lines
11 KiB

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