Update README and script to accept path
This commit is contained in:
parent
4fc23261b3
commit
2983739725
@ -28,7 +28,7 @@ Or, create a custom server:
|
||||
|
||||
```javascript
|
||||
var PeerServer = require('peer').PeerServer;
|
||||
var server = new PeerServer({ port: 9000 });
|
||||
var server = new PeerServer({port: 9000, path: '/myapp'});
|
||||
```
|
||||
|
||||
Connecting to the server from PeerJS:
|
||||
@ -36,7 +36,7 @@ Connecting to the server from PeerJS:
|
||||
```html
|
||||
<script>
|
||||
// No API key required when not using cloud server
|
||||
var peer = new Peer('someid', {host: 'localhost', port: 9000});
|
||||
var peer = new Peer('someid', {host: 'localhost', port: 9000, path: '/myapp'});
|
||||
</script>
|
||||
```
|
||||
|
||||
|
@ -49,7 +49,11 @@ var path = require('path')
|
||||
port: {
|
||||
demand: true,
|
||||
alias: 'p',
|
||||
description: 'port',
|
||||
description: 'port'
|
||||
},
|
||||
path: {
|
||||
demand: false,
|
||||
description: 'custom path'
|
||||
}
|
||||
}).argv;
|
||||
|
||||
@ -67,5 +71,5 @@ process.on('uncaughtException', function(e) {
|
||||
|
||||
var server = new PeerServer(opts);
|
||||
console.log(
|
||||
"Started PeerServer, port: " + opts.port + (" (v. %s)"), version
|
||||
'Started PeerServer, port: ' + opts.port + ', path: ' + (opts.path || '/') + (" (v. %s)"), version
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user