}
private void sendMessage(HttpMessage msg, Channel channel, ByteBuf out, String type) {
HttpResponse res = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.OK);
res.headers().add(CONTENT_TYPE, type).add("Set-Cookie", "io=" + msg.getSessionId())
.add(CONNECTION, KEEP_ALIVE);
addOriginHeaders(channel, res);
HttpHeaders.setContentLength(res, out.readableBytes());