Questions tagged [unix-socket]

UNIX domain sockets are a technology for interprocess communication on a single computer.

UNIX domain sockets are a technology for interprocess communication on a single computer. They allow processes on the same machine to establish bidirectional connections to exchange either continuous byte streams or datagram messages.

The API is in many places the same as the one used for TCP/IP network sockets. A UNIX domain socket listening for connections may be represented as an inode in the file system, depending on the operating system and the parameters used to bind that socket.

Unix Domain Sockets can only communicate within a Linux OS kernel, they can not communicate externally to a kernel.

Details are provided in the unix(7) man page.

699 questions
14
votes
3 answers

Connecting to an already established UNIX socket with node.js?

I am working on a node.js application that will connect to a UNIX socket (on a Linux machine) and facilitate communication between a web page and that socket. So far, I have been able to create socket and communicate back and forth with this code in…
AnalogWeapon
  • 550
  • 1
  • 4
  • 16
13
votes
4 answers

Reading / Writing from a Unix Socket in Ruby

I'm trying to connect, read and write from a UNIX socket in Ruby. It is a stats socket used by haproxy. My code is the following: require 'socket' socket = UNIXSocket.new("/tmp/haproxy.stats.socket") # First attempt: works socket.puts("show…
Olly
  • 3,409
  • 3
  • 24
  • 28
13
votes
4 answers

Use Python xmlrpclib with unix domain sockets?

I'm trying to interact with supervisord, and I'd like to talk with it over a unix socket (it's a shared hosting environment). What I've tried so far is: import xmlrpclib server =…
Marcin
  • 48,559
  • 18
  • 128
  • 201
13
votes
2 answers

SO_PEERCRED vs SCM_CREDENTIALS - why there are both of them?

SO_PEERCRED is simple way to get pid/uid/gid of connected AF_UNIX stream socket, SCM_CREDENTIALS is more or less the same, but more complex (various ancillary messages). Links to example showing both ways. Why there are two ways to get more or less…
Vi.
  • 37,014
  • 18
  • 93
  • 148
12
votes
5 answers

Enable password and unix_socket authentication for MariaDB root user?

I've a root User on the MariaDB on Ubuntu 16.04. As default the root user is authenticated by the unix_socket authentication plugin. I can switch the authentication method to password method by setting update mysql.user set plugin='' where…
powerpete
  • 2,663
  • 2
  • 23
  • 49
11
votes
0 answers

Web developer tools on Android

I'm trying to find a way to use the developer tools in one of the Android browsers, e.g. Chrome and Firefox. They appear to not be shipped with the builds, to avoid cluttering them with functionality used by less than 1% of users I guess. My…
11
votes
2 answers

Node.js: Send GET request via unix socket

I am new to the node.js. I am trying to setup the client server connection using unix socket, where my client request would be in node.js and server running in the background would be in go. Client side Code: var request = require('request'); …
Nikita Kodkani
  • 165
  • 1
  • 2
  • 11
11
votes
4 answers

Node Express Unix Domain Socket Permissions

I am running an nginx server and a node express web server, using daemontools, setup to communicate over Unix Domain Sockets. There's just a few problems: The socket file stays present on shutdown, so I have to delete it when bringing the server…
Bobby
  • 1,439
  • 2
  • 16
  • 30
11
votes
3 answers

How to reliably unlink() a Unix domain socket in Go programming language

I have a Go program hosting a simple HTTP service on localhost:8080 so I can connect my public nginx host to it via the proxy_pass directive, as a reverse proxy to serve part of my site's requests. This is all working great, no problems there. I…
James Dunne
  • 3,607
  • 3
  • 24
  • 29
11
votes
4 answers

erlang: UNIX domain socket support?

Is there a way to access UNIX domain sockets (e.g. /var/run/dbus/system_bus_socket ) directly from Erlang without resorting to a third-party driver?
jldupont
  • 93,734
  • 56
  • 203
  • 318
11
votes
2 answers

LocalSocket communication with Unix Domain in Android NDK

I have Android application, which needs to establish unix domain socket connection with our C++ library (using Android NDK) public static String SOCKET_ADDRESS = "your.local.socket.address"; // STRING There is LocalSocket in java which accepts…
Rohit
  • 6,941
  • 17
  • 58
  • 102
10
votes
2 answers

Is there a way to get the uid of the other end of a unix socket connection

Is there a way for a UNIX domain socket listener to only accept connection from certain user (chmod/chown does not work for abstract socket afaik), or in another word, get the uid of the incoming connection (on Linux)? Dbus, which uses abstract unix…
yuyichao
  • 768
  • 6
  • 28
10
votes
3 answers

Run dbus-daemon inside Docker container

I am trying to create a Docker container with a custom D-Bus bus running inside. I configured my Dockerfile as follow: FROM ubuntu:16.04 COPY myCustomDbus.conf /etc/dbus-1/ RUN apt-get update && apt-get install -y dbus RUN dbus-daemon…
oOnez
  • 887
  • 2
  • 11
  • 23
10
votes
5 answers

PHP Artisan Migrate with MAMP and Unix Socket

I was developing my application originally in Laravel 4.2 but have since decided to move it to the 5.0 version so that it covers a lot more changes and strengths that 5.0 has over 4.2. I am trying to run my migratiosn however I am getting the…
user3732216
  • 1,579
  • 8
  • 29
  • 54
10
votes
2 answers

Getting "Address already in use" error using Unix socket

Writing the C source below using Unix local sockets I got an error about the address already in use. After having checked man 7 Unix for further informations I tried to create a sub-folder where executing my program (obviously modifying the sun_path…
Acsor
  • 1,011
  • 2
  • 13
  • 26
1 2
3
46 47