-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Implemented BackEnd WebSocket Adapters
- Loading branch information
Jonathan
committed
May 7, 2018
1 parent
cc30caa
commit debcfef
Showing
10 changed files
with
129 additions
and
27 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "9" | ||
- "9" | ||
before_install: | ||
- npm install uws @types/uws |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as DepWebSocket from 'uws'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import {WebSocketAdapter} from '../interfaces'; | ||
/** | ||
* @class UWSAdapter | ||
* @author Jonathan Casarrubias | ||
* @license MIT | ||
* @description This adapter will use the uws dependency | ||
*/ | ||
export class UWSAdapter implements WebSocketAdapter { | ||
WebSocket(server: http.Server | https.Server): DepWebSocket.Server { | ||
return new DepWebSocket.Server({server}); | ||
} | ||
} |
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,15 @@ | ||
import * as DepWebSocket from 'ws'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import {WebSocketAdapter} from '../interfaces'; | ||
/** | ||
* @class WSAdapter | ||
* @author Jonathan Casarrubias | ||
* @license MIT | ||
* @description This adapter will use the ws dependency | ||
*/ | ||
export class WSAdapter implements WebSocketAdapter { | ||
WebSocket(server: http.Server | https.Server): DepWebSocket.Server { | ||
return new DepWebSocket.Server({server}); | ||
} | ||
} |
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
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