This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ce3aef
commit 783f111
Showing
5 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict' | ||
|
||
const Ws = use('Ws') | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Global Middleware | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Global middleware are executed on every websocket request handshake and | ||
| must be defined inside below array. | ||
| | ||
*/ | ||
const globalMiddleware = [ | ||
'Adonis/Middleware/AuthInit' | ||
] | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Named Middleware | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Named middleware are key/value pairs. Keys are later used on websocket | ||
| channels. | ||
| | ||
*/ | ||
const namedMiddleware = { | ||
auth: 'Adonis/Middleware/Auth' | ||
} | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Register Middleware | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Here we finally register our defined middleware to Middleware provider. | ||
| | ||
*/ | ||
Ws.global(globalMiddleware) | ||
Ws.named(namedMiddleware) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
|
||
/* | ||
|----------------------------------------------------------------------------- | ||
| Web Socket | ||
|----------------------------------------------------------------------------- | ||
| | ||
| WebSocket provider makes it so simple for you to write realtime applications | ||
| with the power of channels and dynamic rooms. Make use of this file to | ||
| define channels and bind controllers next to them. | ||
| | ||
| | ||
| @example | ||
| Ws.channel('/chat', 'ChatController') | ||
*/ | ||
|
||
const Ws = use('Ws') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters