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.

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