Подключение процесса узла с помощью node-ipc выдает ошибку: connect EACCES - PullRequest
0 голосов
/ 04 октября 2019

У меня есть приложения с двумя узлами, одно на учетной записи сервера debian, которое называется «провайдер». На провайдере у меня есть приложение ipc server, работающее в моем приложении узла, которое имеет следующую конфигурацию:

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 meteor на учетной записи «Наблюдатель». Это приложение подключается к 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 server на разных учетных записях пользователей?

...