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.

252 lines
11 KiB

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