#Using unix socket

1 messages · Page 1 of 1 (latest)

sharp shadow
#

I get connection refused: Unable to connect when using unix socket -

  let options = {
    socketPath: '/var/run/docker.sock',
    path: `/v1.43/containers/json`,
    method: 'GET',
  };
  let clientRequest = http.request(options, (res) => {
    res.setEncoding('utf8');
    let rawData = '';
    res.on('data', (chunk) => {
      rawData += chunk;
    });
    res.on('end', () => {
      const parsedData = JSON.parse(rawData);
      console.log(parsedData);
    });
  });
  clientRequest.on('error', (e) => {
    console.log(e);
  });
  clientRequest.end();
sharp shadow
#

currently i am spawning a shell and using curl

glad steeple