[11] UNIXドメインソケットは、 多くの UNIX 系システムで実装されている IPC 機構の一種です。
[1] 様々なアプリケーションプロトコルの下位層として用いられています。
[10] HTTP での利用については、 HTTP接続を参照。
[36] RFC 1459 - Internet Relay Chat Protocol, , https://tools.ietf.org/html/rfc1459#section-8.1.1
[35] Addressing HTTP servers over Unix domain sockets · Issue #577 · whatwg/url · GitHub, https://github.com/whatwg/url/issues/577
unix:
#✎[5] URL scheme として unix:
が使われることがあります。
unix://path/to/socket -> Unix socket located at path/to/socket
$ sudo <path to>/docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d &
unix://[:password]@/path/to/socket.sock?db=0
Unix local socket
The required syntax for a Unix socket URL is:
unix://filepath
udg:
#✎[13] PHP5以上では Unix domain socket によるデータグラム (UDP 相当)
を表すために udg:
を使っています。
[33] Docker
は
http://%2Fvar%2Frun%2Fdocker.sock/
のような
URL
を使っています。
[20] 実装によっては、ホストを unix/
、ポートをファイル名とすることで、
TCP ではなく UNIX domain socket での接続として扱うことがあります。
The following connects to a UNIX domain socket:
mongodb:///tmp/mongodb-27017.sock
or as a UNIX-domain socket path specified after the word “unix” and enclosed in colons:
proxy_pass http://unix:/tmp/backend.socket:/uri/;
If the $text is unix/, then this function returns a special token recognised by the other functions in this module to mean "UNIX domain socket".
With PostgreSQL, you can also use unix domain socket paths with percent encoding: postgres://%2Fvar%2Flib%2Fpostgresql/dbname.
If a unix socket connection should be used, the URL needs to be in the format:
redis+socket:///path/to/redis.sock
[18] Issue 376323002: Refactor unix domain socket. - Code Review ( 版) https://codereview.chromium.org/376323002/
--unix-socket <path>
(HTTP) Connect through this Unix domain socket, instead of using the network. (Added in 7.40.0)
[34] curl - How To Use, , https://curl.haxx.se/docs/manpage.html#--abstract-unix-socket
The following connects to a UNIX domain socket:
mongodb:///tmp/mongodb-27017.sock
mysql+mysqldb://root@/<dbname>?unix_socket=/cloudsql/<projectid>:<instancename>
As another answer pointed out, it's possible (at least in Intellij IDE) to use socket connection for Mysql JDBC Connector/J (I am using version 5.1) without having to provide a socketFactory,
jdbc:mysql://localhost:3306/database_name?socket=/tmp/mysql.sock
The JDBC Driver from the MariaDB project supports Unix domain sockets while remaining compatible with the MySQL Connector/J JDBC driver. Example jdbc url for the MariaDB driver is: jdbc:mariadb://localhost:3306/revmgt?localSocket=/var/run/mysqld/mysqld.sock
mysql://localhost/database?unix_socket=/var/lib/mysql/socket
If your Linux or OS X installation has a standard setup and there’s a live socket at /tmp/.s.PGSQL.5432, your SQLAlchemy PostgreSQL dburi can be this simple:
postgres:///dbname
To specify the socket file for PostgreSQL, put the absolute path after the double slash:
postgres:///var/run/postgresql/test?debug=1
However, there are bugs in the DSN parser for SQLObject, so that it fails to separate the socket path from the database name. A DSN like this works around that issue:
postgres:///dbname?host=/path/to/socket
connection_url = None (StrOpt) URL for connection to XenServer/Xen Cloud Platform. A special value of unix://local can be used to connect to the local unix socket. Required if compute_driver=xenapi.XenAPIDriver
The knxconnection element configures the connection to EIBD. The url parameter can be "local:/path/to/unix/socket" if EIBD uses unix sockets or "ip:ip-address:port" if EIBD uses internet sockets (port is optional; default = 6720)
DOCKER_HOST
Sets the URL of the docker daemon. As with the Docker client, defaults to unix:///var/run/docker.sock.