{"action":"opened","issue":{"url":"https://api.github.com/repos/ivyboy/nettyWebsocket/issues/2","labels_url":"https://api.github.com/repos/ivyboy/nettyWebsocket/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/ivyboy/nettyWebsocket/issues/2/comments","events_url":"https://api.github.com/repos/ivyboy/nettyWebsocket/issues/2/events","html_url":"https://github.com/ivyboy/nettyWebsocket/issues/2","id":97185485,"number":2,"title":"nettyWebsocket support BinaryWebsocketFrame","user":{"login":"hijackwust","id":13492095,"avatar_url":"https://avatars.githubusercontent.com/u/13492095?v=3","gravatar_id":"","url":"https://api.github.com/users/hijackwust","html_url":"https://github.com/hijackwust","followers_url":"https://api.github.com/users/hijackwust/followers","following_url":"https://api.github.com/users/hijackwust/following{/other_user}","gists_url":"https://api.github.com/users/hijackwust/gists{/gist_id}","starred_url":"https://api.github.com/users/hijackwust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hijackwust/subscriptions","organizations_url":"https://api.github.com/users/hijackwust/orgs","repos_url":"https://api.github.com/users/hijackwust/repos","events_url":"https://api.github.com/users/hijackwust/events{/privacy}","received_events_url":"https://api.github.com/users/hijackwust/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-25T03:13:53Z","updated_at":"2015-07-25T03:13:53Z","closed_at":null,"body":"1.  ChatServerInitializer.java \r\nprotected void initChannel(Channel ch) throws Exception {\r\n\t\tChannelPipeline pipeline = ch.pipeline();\r\n\t\t\r\n\t\tpipeline.addLast(new HttpServerCodec());\r\n\t\t\r\n\t\tpipeline.addLast(new ChunkedWriteHandler());\r\n\t\t\r\n\t\tpipeline.addLast(new HttpObjectAggregator(64*1024));\r\n\t\t\r\n\t\tpipeline.addLast(new HttpRequestHandler(\"/ws\"));\r\n\t\t\r\n\t\tpipeline.addLast(new WebSocketServerProtocolHandler(\"/ws\"));\r\n\t\t\r\n\t\t//pipeline.addLast(new TextWebSocketFrameHandler(group));\r\n\t\tpipeline.addLast(new WebSocketFrameHandler(group));\r\n\t}\r\n\r\n2. WebSocketFrameHandler extends SimpleChannelInboundHandler<WebSocketFrame> \r\n\r\n@Override\r\n\tprotected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame msg) throws Exception {\r\n\t\tif(msg instanceof TextWebSocketFrame){\r\n\t\t\tTextWebSocketFrame msg1 =(TextWebSocketFrame)msg;\r\n\t\t\tSystem.out.println(\"server recieved TextWebSocketFrame=\"+msg1.text());\r\n\t\t}else if(msg instanceof BinaryWebSocketFrame){\r\n\t\t\tBinaryWebSocketFrame msg1 =(BinaryWebSocketFrame)msg;\r\n\t\t\tSystem.out.println(\"server recieved BinaryWebSocketFrame=\"+msg1.content().toString(Charset.forName(\"utf-8\")));\r\n\t\t}\r\n\t\tgroup.writeAndFlush(msg.retain());\r\n\t}\r\n"}}