Skip to content

Commit

Permalink
updating node to v10.16.3; version 0.8.0 is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-portmen committed Sep 15, 2019
1 parent 76b6f20 commit 7e9019a
Show file tree
Hide file tree
Showing 13 changed files with 273 additions and 322 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Native Client [![Build Status](https://travis-ci.org/andy-portmen/native-client.svg?branch=master)](https://travis-ci.org/andy-portmen/native-client)

This comment has been minimized.

Copy link
@zbarnett124

zbarnett124 Sep 24, 2020

thank you


This [NodeJS](https://nodejs.org/) based small client helps the following extensions to communicate with your operating system. To see the latest log visit [travis-ci.org](https://travis-ci.org/andy-portmen/native-client).

This comment has been minimized.

Copy link
@sergio838

sergio838 Nov 27, 2020

uninstall.bat.

This [NodeJS](https://nodejs.org/)-based small client helps the following extensions to communicate with your operating system. To see the latest log visit [travis-ci.org](https://travis-ci.org/andy-portmen/native-client).

1. Open in Firefox [open Firefox browser with provided URL]
1. Open in Google Chrome [open Google Chrome browser with provided URL]
Expand All @@ -14,7 +14,7 @@ This [NodeJS](https://nodejs.org/) based small client helps the following extens
7. Open in VLC media Player [open VLC media Player with provided URL]
8. Media Converter and Muxer [Download FFmpeg media converter, Open FFmpeg, Export media files to a temporary directory then call FFmpeg]

You can find up-to-date list as well as IDs here: https://github.com/andy-portmen/native-client/blob/master/config.js

This comment has been minimized.

Copy link
@cuznvinny49

cuznvinny49 Mar 2, 2022

i/am/a little confuse to what or howo remedy this//

You can find the complete list as well as official IDs in the [config.js](https://github.com/andy-portmen/native-client/blob/master/config.js) file.

This comment has been minimized.

Copy link
@cuznvinny49

cuznvinny49 Mar 2, 2022

thanks.


How to install

Expand Down
1 change: 0 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals exports */
'use strict';

exports.ids = {
Expand Down
88 changes: 23 additions & 65 deletions host.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals global, require, process, Buffer */
'use strict';

function lazyRequire(lib, name) {
Expand All @@ -11,20 +10,17 @@ function lazyRequire(lib, name) {
return global[name];
}

var spawn = require('child_process').spawn;
var fs = lazyRequire('fs');
var net = lazyRequire('net');
var os = lazyRequire('os');
var path = lazyRequire('path');
var http = lazyRequire('./follow-redirects').http;
var https = lazyRequire('./follow-redirects').https;
const spawn = require('child_process').spawn;
const fs = lazyRequire('fs');
const os = lazyRequire('os');
const path = lazyRequire('path');

var server;
var files = [];
var sprocess = [];
let server;
let files = [];
const sprocess = [];

var config = {
version: '0.7.2'
const config = {
version: '0.8.0'
};
// closing node when parent process is killed
process.stdin.resume();
Expand All @@ -44,12 +40,12 @@ process.stdin.on('end', () => {
process.exit();
});

/////////////////process.on('uncaughtException', e => console.error(e));
// process.on('uncaughtException', e => console.error(e));

function observe(msg, push, done) {
if (msg.cmd === 'version') {
push({
version: config.version,
version: config.version
});
done();
}
Expand Down Expand Up @@ -108,6 +104,7 @@ function observe(msg, push, done) {
done();
}
else if (msg.cmd === 'ifup') {
const http = require('./follow-redirects').http;
server = http.createServer(function(req, res) {
if (req.headers['api-key'] !== msg.key) {
res.statusCode = 400;
Expand All @@ -127,7 +124,7 @@ function observe(msg, push, done) {
res.end('File is stored locally');
});
});
file.on('error', e => {
file.on('error', () => {
res.statusCode = 400;
res.end('HTTP/1.1 400 Bad Request');
});
Expand Down Expand Up @@ -239,46 +236,6 @@ function observe(msg, push, done) {
});
done();
}
/* cmd === download is deprecated. Use browser's built-in download manager */
else if (msg.cmd === 'download') {
const file = fs.createWriteStream(msg.filepath);
const request = https.get({
hostname: msg.hostname,
port: msg.port,
path: msg.path
}, response => {
const size = parseInt(response.headers['content-length']);
response.pipe(file);
file.on('finish', () => {
if (msg.chmod) {
fs.chmodSync(msg.filepath, msg.chmod);
}
file.close(() => {
const s = fs.statSync(msg.filepath).size;
push({
size,
path: msg.filepath,
code: s === size ? 0 : 1004,
error: s !== size ? `file-size (${s}) does not match the header content-length (${size}).
Link: ${msg.hostname}/${msg.path}` : null
});
done();
});
});
});
request.on('error', err => {
fs.unlink(msg.filepath);
push({
error: err.message,
code: 1001
});
done();
});
request.on('socket', function(socket) {
socket.setTimeout(msg.timeout || 60000);
socket.on('timeout', () => request.abort());
});
}
else if (msg.cmd === 'save-data') {
const matches = msg.data.match(/^data:.+\/(.+);base64,(.*)$/);
if (matches && matches.length) {
Expand Down Expand Up @@ -323,6 +280,7 @@ function observe(msg, push, done) {
}
else if (msg.cmd === 'net') {
let stdout = '';
const net = require('net');
const connection = net.connect({
port: msg.port,
host: msg.host,
Expand Down Expand Up @@ -462,7 +420,7 @@ function observe(msg, push, done) {
require: name => (msg.permissions || []).indexOf(name) === -1 ? null : require(name)
};
const script = new vm.Script(msg.script);
const context = new vm.createContext(sandbox);
const context = vm.createContext(sandbox);
script.runInContext(context);
}
else {
Expand All @@ -475,14 +433,14 @@ function observe(msg, push, done) {
}
}
/* message passing */
var nativeMessage = require('./messaging');
const nativeMessage = require('./messaging');

var input = new nativeMessage.Input();
var transform = new nativeMessage.Transform(observe);
var output = new nativeMessage.Output();
const input = new nativeMessage.Input();
const transform = new nativeMessage.Transform(observe);
const output = new nativeMessage.Output();

process.stdin
.pipe(input)
.pipe(transform)
.pipe(output)
.pipe(process.stdout);
.pipe(input)
.pipe(transform)
.pipe(output)
.pipe(process.stdout);
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ if [ $isNode -eq 0 ]; then
fi
if [ $isNode -eq 0 ]; then
echo "Installer is using your system NodeJS."
echo
node install.js `which node` $1
else
MACHINE_TYPE=`uname -m`
echo "Installer is using the attached NodeJS"
echo "Installer is using the embedded NodeJS"
echo
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
../node/x64/node install.js --add_node $1
else
Expand Down
Loading

0 comments on commit 7e9019a

Please sign in to comment.