Skip to content

Commit aee0184

Browse files
committed
Merge pull request koush#238 from paulpdaniels/patch-2
Added protected API for WebSocket creation
2 parents 8a2a956 + 4ee0ae0 commit aee0184

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

AndroidAsync/src/com/koushikdutta/async/http/server/AsyncHttpServer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,15 @@ public void onRequest(final AsyncHttpServerRequest request, final AsyncHttpServe
318318
response.end();
319319
return;
320320
}
321-
callback.onConnected(new WebSocketImpl(request, response), request.getHeaders());
321+
callback.onConnected(createWebSocket(request, response), request.getHeaders());
322322
}
323323
});
324324
}
325325

326+
protected WebSocket createWebSocket(final AsyncHttpServerRequest request, final AsyncHttpServerResponse response) {
327+
return new WebSocketImpl(request, response);
328+
}
329+
326330
public void get(String regex, HttpServerRequestCallback callback) {
327331
addAction(AsyncHttpGet.METHOD, regex, callback);
328332
}

0 commit comments

Comments
 (0)