Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | // Protocol references:
|
---|
| 4 | //
|
---|
| 5 | // * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75
|
---|
| 6 | // * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
|
---|
| 7 | // * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17
|
---|
| 8 |
|
---|
| 9 | var Base = require('./driver/base'),
|
---|
| 10 | Client = require('./driver/client'),
|
---|
| 11 | Server = require('./driver/server');
|
---|
| 12 |
|
---|
| 13 | var Driver = {
|
---|
| 14 | client: function(url, options) {
|
---|
| 15 | options = options || {};
|
---|
| 16 | if (options.masking === undefined) options.masking = true;
|
---|
| 17 | return new Client(url, options);
|
---|
| 18 | },
|
---|
| 19 |
|
---|
| 20 | server: function(options) {
|
---|
| 21 | options = options || {};
|
---|
| 22 | if (options.requireMasking === undefined) options.requireMasking = true;
|
---|
| 23 | return new Server(options);
|
---|
| 24 | },
|
---|
| 25 |
|
---|
| 26 | http: function() {
|
---|
| 27 | return Server.http.apply(Server, arguments);
|
---|
| 28 | },
|
---|
| 29 |
|
---|
| 30 | isSecureRequest: function(request) {
|
---|
| 31 | return Server.isSecureRequest(request);
|
---|
| 32 | },
|
---|
| 33 |
|
---|
| 34 | isWebSocket: function(request) {
|
---|
| 35 | return Base.isWebSocket(request);
|
---|
| 36 | },
|
---|
| 37 |
|
---|
| 38 | validateOptions: function(options, validKeys) {
|
---|
| 39 | Base.validateOptions(options, validKeys);
|
---|
| 40 | }
|
---|
| 41 | };
|
---|
| 42 |
|
---|
| 43 | module.exports = Driver;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.