我有两个节点应用程序,一个在名为:“ provider”的debian服务器帐户上。在提供程序上,我的节点应用程序中运行着ipc服务器,该服务器具有以下配置:
var ipc = require('node-ipc');
ipc.config.id = 'remote_provider';
ipc.config.retry= 1500;
ipc.config.sync = true;
ipc.serve(
function(){
ipc.server.on(
'grab',
async function(data,socket){
var result;
//some computation and stuff not related to question
ipc.server.emit(
socket,
'result',
result
);
}
);
ipc.server.on(
'socket.disconnected',
function(socket, destroyedSocketID) {
ipc.log('client ' + destroyedSocketID + ' has disconnected!');
}
);
}
);
ipc.server.start();
我也有一个帐户“观察者”的客户端nodejs流星应用程序。 此应用程序按需将客户端提供给“提供者” ip服务器,然后获取一些数据。
客户端ipc如下所示:
var ipc=require('node-ipc');
ipc.config.id = 'observer_request_' + user_id;
ipc.config.retry = 1000;
ipc.config.maxRetries = 0;
ipc.config.sync = true;
ipc.connectTo('remote_provider');
ipc.of.remote_provider.on(
'disconnect',
function () {
ipc.log('disconnected'.notice);
}
);
ipc.of.remote_provider.on(
'error',
function (err) {
ipc.log(err);
}
);
ipc.of.remote_provider.on(
'result',
function (data) {
console.log(data);
}
);
ipc.of.remote_provider.emit(
'grab',
id
);
On localhost i tested this setup on the same account, works good. But on server, when i uploaded to different accounts, get this error on client, when trying to connect:
connect EACCES /tmp/app.data_provider
有人可以帮助将客户端连接到其他用户帐户上的ipc服务器吗?