seneca-transport
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -8,2 +8,3 @@ /* Copyright (c) 2013-2015 Richard Rodger, MIT License */ | ||
var Http = require('http') | ||
var Https = require('https') | ||
var Qs = require('qs') | ||
@@ -23,3 +24,4 @@ var Url = require('url') | ||
var server = Http.createServer() | ||
var server = (listenOptions.protocol === 'https') ? Https.createServer(listenOptions.serverOptions) : Http.createServer() | ||
var listener | ||
@@ -98,3 +100,3 @@ var listenAttempts = 0 | ||
var url = 'http://' + host + ':' + port + path | ||
var url = clientOptions.protocol + '://' + host + ':' + port + path | ||
seneca.log.debug('client', 'web', 'send', spec, topic, clientOptions, url) | ||
@@ -159,3 +161,2 @@ | ||
} | ||
transportUtil.make_client(seneca, send, clientOptions, callback) | ||
@@ -162,0 +163,0 @@ } |
{ | ||
"name": "seneca-transport", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Seneca transport", | ||
@@ -5,0 +5,0 @@ "main": "transport.js", |
@@ -8,3 +8,3 @@ ![Seneca](http://senecajs.org/files/assets/seneca-logo.png) | ||
This plugin provides the HTTP and TCP transport channels for | ||
This plugin provides the HTTP/HTTPS and TCP transport channels for | ||
micro-service messages. It's a built-in dependency of the Seneca | ||
@@ -79,2 +79,35 @@ module, so you don't need to include it manually. You use this plugin | ||
Example with HTTPS | ||
To enable HTTPS make sure to set the protocol option to 'https' and in the | ||
listen function set the serverOptions object with the `key` and `cert` keys. | ||
```js | ||
var seneca = require('seneca') | ||
var Fs = require('fs') | ||
seneca() | ||
.use(color) | ||
.listen( | ||
type: 'http', | ||
port: '8000', | ||
host: 'localhost', | ||
protocol: 'https', | ||
serverOptions : { | ||
key : Fs.readFileSync('path/to/key.pem', 'utf8'), | ||
cert : Fs.readFileSync('path/to/cert.pem', 'utf8') | ||
} | ||
) | ||
seneca() | ||
.client({ | ||
type: 'http', | ||
port: '8000', | ||
host: 'localhost', | ||
protocol: 'https' | ||
}) | ||
.act('color:red') | ||
``` | ||
You can create multiple instances of Seneca inside the same Node.js | ||
@@ -81,0 +114,0 @@ process. They won't interfere with each other, but they will share |
/* Copyright (c) 2013-2015 Richard Rodger & other contributors, MIT License */ | ||
/* jshint node:true, asi:true, eqnull:true */ | ||
'use strict' | ||
@@ -37,3 +38,4 @@ | ||
max_listen_attempts: 11, | ||
attempt_delay: 222 | ||
attempt_delay: 222, | ||
serverOptions: {} | ||
}, | ||
@@ -40,0 +42,0 @@ tcp: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67176
10078
1013
929
3