URGENT - how to load https pages from remote server, and execute locally for nodejs usage?
See original GitHub issueIntroduction:
We are doing a new research project recently with node-webkit see the above picture. Where node-webkit loads a simple https web url where we have all our nodejs scripts to access serial port, java-applets, tcp/udp etc etc to send and receive commands from a robot. after receiving all those information we need to send them to server, server does all the management and do a proper interpretation for the other robots to simulate same actions.
Problem:
But the node-webkit limitation is killing our project deadline because its not allowing very basic access when we load the pages using https / http instead of local.
We have our closed source code in cloud servers, all the node-webkit runs in Local machine and executes the web page as https://load-from-server, now we place all our device access codes in remote server instead of local and we need to have full access on that PC just like if you had the script executed locally. We also require this because our remote scripts get automatically upto date.
How can we make this possible in node-webkit, its a very important requirement for our use case but i have not found any solution for it yet.
Question: How can i tell node-webkit that following lines if loaded via https or http from remote server run them as it was running well using local index.html?
var gui = require('nw.gui');
var sys = require('sys')
var exec = require('child_process').exec;
var os = require('os');
var win = gui.Window.get();
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
@shamun: unless I’m misunderstanding your requirements, your problem should be easily solvable by providing the appropriate
node-remote
key in your manifest.Assuming that your app lives on
https://production.com
you could do something like the following:Client
package.json
To be shipped with the NW binaries, either standalone or packaged by itself inside
app.nw
, or similar.⚠️ DANGER:
node-remote
can be dangerous if mis-used/configured. You should be as granular as possible when specifying which sources should have remote execution privileges.Server
index.html
Located in
/
.app.js
Located in
/
.That is the problem, we can not use index.html from local for many use policy. We need to use the index.html as https://load-from-server and have the same feature like running it from local index.html.
Is there any way use index.html locally but on the fly get the latest versions of nodejs script which can be injected from HTTPS SERVER at-least so that we do not have to always modify the index.html?