2018-11-04 00:56:25 +00:00
|
|
|
Loopery is Google V8 tied to µWebSockets for building high performance JavaScript backend services.
|
2018-07-28 20:48:22 +00:00
|
|
|
|
|
|
|
```javascript
|
2018-10-04 21:18:50 +00:00
|
|
|
const uWS = require('...lalala');
|
2018-07-28 20:48:22 +00:00
|
|
|
|
2018-10-04 21:18:50 +00:00
|
|
|
const app = uWS.SSLApp({
|
|
|
|
cert: 'my_cert.pem',
|
|
|
|
key: 'my_key.pem'
|
|
|
|
}).get('/whatsmy/useragent', (res, req) => {
|
|
|
|
res.end('Hello ' + req.getHeader('user-agent'));
|
|
|
|
}).get('/*', (res, req) => {
|
|
|
|
res.end('Hello otherwise!');
|
|
|
|
}).listen(3000, 0, (token) => {
|
|
|
|
console.log('Listening to port 3000');
|
|
|
|
});
|
2018-07-28 20:48:22 +00:00
|
|
|
```
|
2018-11-03 11:45:56 +00:00
|
|
|
|
|
|
|
### Benchmarks
|
|
|
|
Performance retention is up to 70% of native C++ µWebSockets v0.15.
|
|
|
|
![](benchmarks.png)
|
2018-11-03 23:17:07 +00:00
|
|
|
|
|
|
|
### Kick-start
|
|
|
|
The following works for Linux and macOS systems:
|
|
|
|
```
|
|
|
|
git clone --recursive https://github.com/uNetworking/uWebSockets-node.git
|
|
|
|
cd uWebSockets-node
|
|
|
|
make
|
|
|
|
node examples/HelloWorld.js
|
|
|
|
```
|