parent
3fbaa2c2c6
commit
23a037c7d3
@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
### vNEXT
|
### vNEXT
|
||||||
|
|
||||||
|
|
||||||
|
### 0.6.1
|
||||||
|
|
||||||
* New: PeerJS Server in Docker capture ^C signal and terminate gracefully. #205
|
* New: PeerJS Server in Docker capture ^C signal and terminate gracefully. #205
|
||||||
|
* Fix: SSL options in default config. #230
|
||||||
|
|
||||||
### 0.6.0
|
### 0.6.0
|
||||||
|
|
||||||
|
4
dist/src/config/index.js
vendored
4
dist/src/config/index.js
vendored
@ -11,9 +11,5 @@ const defaultConfig = {
|
|||||||
allow_discovery: false,
|
allow_discovery: false,
|
||||||
proxied: false,
|
proxied: false,
|
||||||
cleanup_out_msgs: 1000,
|
cleanup_out_msgs: 1000,
|
||||||
ssl: {
|
|
||||||
key: "",
|
|
||||||
cert: ""
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
exports.default = defaultConfig;
|
exports.default = defaultConfig;
|
||||||
|
@ -27,10 +27,6 @@ const defaultConfig: IConfig = {
|
|||||||
allow_discovery: false,
|
allow_discovery: false,
|
||||||
proxied: false,
|
proxied: false,
|
||||||
cleanup_out_msgs: 1000,
|
cleanup_out_msgs: 1000,
|
||||||
ssl: {
|
|
||||||
key: "",
|
|
||||||
cert: ""
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaultConfig;
|
export default defaultConfig;
|
||||||
|
56
test/peerjs.ts
Normal file
56
test/peerjs.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import { expect } from 'chai';
|
||||||
|
import http from 'http';
|
||||||
|
import expectedJson from '../app.json';
|
||||||
|
import { spawn } from 'child_process';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
|
const PORT = '9000';
|
||||||
|
|
||||||
|
async function makeRequest() {
|
||||||
|
return new Promise<object>((resolve, reject) => {
|
||||||
|
http.get(`http://localhost:${PORT}/`, resp => {
|
||||||
|
let data = '';
|
||||||
|
|
||||||
|
resp.on('data', chunk => {
|
||||||
|
data += chunk;
|
||||||
|
});
|
||||||
|
|
||||||
|
resp.on('end', () => {
|
||||||
|
resolve(JSON.parse(data));
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on("error", err => {
|
||||||
|
console.log("Error: " + err.message);
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Check bin/peerjs', () => {
|
||||||
|
it('should return content of app.json file', async () => {
|
||||||
|
let resolver: () => void;
|
||||||
|
let rejecter: (err: Error) => void;
|
||||||
|
const promise = new Promise<void>((resolve, reject) => {
|
||||||
|
resolver = resolve;
|
||||||
|
rejecter = reject;
|
||||||
|
});
|
||||||
|
|
||||||
|
const ls = spawn('node', [path.join(__dirname, '../', 'bin/peerjs'), '--port', PORT]);
|
||||||
|
|
||||||
|
ls.stdout.on('data', async (data: string) => {
|
||||||
|
if (!data.includes('Started')) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const resp = await makeRequest();
|
||||||
|
expect(resp).to.deep.eq(expectedJson);
|
||||||
|
resolver();
|
||||||
|
} catch (error) {
|
||||||
|
rejecter(error);
|
||||||
|
} finally {
|
||||||
|
ls.kill('SIGINT');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise;
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user