Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PHANTOM_BRIDGE_PORT=8087
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.DS_Store
test/files/testrender.png
.idea
3 changes: 2 additions & 1 deletion bridge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//Released to the public domain.

var port=phantom.args[0];
var system = require('system');
var port = system.args[1];
var webpage=require('webpage');
var controlpage=webpage.create();

Expand Down
8 changes: 4 additions & 4 deletions node-phantom.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//Released to the public domain.

var http=require('http');
var socketio=require('socket.io');
var child=require('child_process');

require('dotenv').config();

function callbackOrDummy(callback){
if(callback===undefined)callback=function(){};
return callback;
Expand Down Expand Up @@ -48,14 +48,14 @@ module.exports={
response.writeHead(200,{"Content-Type": "text/html"});
response.end('<html><head><script src="/socket.io/socket.io.js" type="text/javascript"></script><script type="text/javascript">\n\
window.onload=function(){\n\
var socket = new io.connect("http://" + window.location.hostname);\n\
var socket = new io.connect("http://" + window.location.host);\n\
socket.on("cmd", function(msg){\n\
alert(msg);\n\
});\n\
window.socket = socket;\n\
};\n\
</script></head><body></body></html>');
}).listen(function(){
}).listen(process.env.PHANTOM_BRIDGE_PORT, function(){
var io=socketio.listen(server,{'log level':1});

var port=server.address().port;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"test": "mocha"
},
"dependencies": {
"dotenv": "^6.2.0",
"socket.io": ">=0.9.6"
},
"devDependencies": {
"mocha": "*",
"pngjs": "0.4.0"
"mocha": "*",
"pngjs": "0.4.0"
},
"optionalDependencies": {},
"engines": {
Expand Down