|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Rev | Line | |
|---|
| [9af201e] | 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.