summaryrefslogtreecommitdiff
path: root/src/api/streaming.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-06-09 01:03:54 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-06-09 01:03:54 +0900
commit4e5545af384f610a56b3d19ea73c3b801b0be6c6 (patch)
tree4cd0b12e891bd1d8991ac4ad14cbbb7af83a0aee /src/api/streaming.ts
parentv2038 (diff)
downloadsharkey-4e5545af384f610a56b3d19ea73c3b801b0be6c6.tar.gz
sharkey-4e5545af384f610a56b3d19ea73c3b801b0be6c6.tar.bz2
sharkey-4e5545af384f610a56b3d19ea73c3b801b0be6c6.zip
nanka iroiro
Diffstat (limited to 'src/api/streaming.ts')
-rw-r--r--src/api/streaming.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/streaming.ts b/src/api/streaming.ts
index e1d79481d3..c71132100c 100644
--- a/src/api/streaming.ts
+++ b/src/api/streaming.ts
@@ -8,6 +8,7 @@ import isNativeToken from './common/is-native-token';
import homeStream from './stream/home';
import messagingStream from './stream/messaging';
+import serverStream from './stream/server';
module.exports = (server: http.Server) => {
/**
@@ -20,6 +21,11 @@ module.exports = (server: http.Server) => {
ws.on('request', async (request) => {
const connection = request.accept();
+ if (request.resourceURL.pathname === '/server') {
+ serverStream(request, connection);
+ return;
+ }
+
const user = await authenticate(connection, request.resourceURL.query.i);
if (user == null) {