A communication end-point for networking, for CPUs please use [processor-socket]
Questions tagged [sockets]
270 questions
225
votes
7 answers
Allow non-root process to bind to port 80 and 443?
Is it possible to tune a kernel parameter to allow a userland program to bind to port 80 and 443?
The reason I ask is I think its foolish to allow a privileged process to open a socket and listen. Anything that opens a socket and listens is high…
jww
- 11,918
- 44
- 119
- 208
145
votes
15 answers
Manually closing a port from commandline
I want to close an open port which is in listening mode between my client and server application.
Is there any manual command line option in Linux to close a port?
NOTE: I came to know that "only the application which owns the connected socket…
codingfreak
119
votes
2 answers
Can cURL send requests to sockets?
I have a HTTP server running at /var/run/my-server.sock, and I want to test it by sending a simple request using cURL. Can this be done using cURL? Can it be done at all, or must there be a reverse proxy in place?
I'm imagining something like…
Hubro
- 5,716
- 14
- 61
- 87
90
votes
5 answers
Can I monitor a local unix domain socket like tcpdump?
I'd like to monitor responses on a unix socket without disturbing the original connections and pipe them to a script for processing.
I know how to do this with tcpdump for tcp connections but I cannot seem to find a solution for local unix…
ck_
- 1,875
- 1
- 16
- 16
67
votes
2 answers
Why was port 80 chosen as the default HTTP port and 443 as the default HTTPS port?
Why was port 80 chosen as the default HTTP port and 443 as the default HTTPS port?
Is there a reason or was it is just defined that way?
Samuel Alexander
- 803
- 2
- 8
- 11
43
votes
3 answers
Linux named sockets howto
I know that there are named sockets & named pipes (fifo) in Linux.
In ls -l, they would look as below: (I have changed the filenames, for demonstration.)
prw-r--r-- 1 root root 0 Nov 8 16:31 /tmp/fifo
srwxrwxrwx 1 root root 0 Nov 8 15:54…
anishsane
- 905
- 1
- 8
- 18
34
votes
6 answers
How to determine the socket connection up time on Linux
I can verify that the connection is up:
$ netstat -tn | grep "192.168.2.110"
tcp 0 0 192.168.2.100:10444 192.168.2.110:52639 ESTABLISHED
is there a way to check how long this tcp port connection was up (connected)?
(No, I don't have access to…
hidralisk
- 443
- 1
- 4
- 6
22
votes
1 answer
What is the simplest way to test a plain socket server
I have a server which listens on a socket for incoming connections and outputs a welcome text ("Hello world"). What is the simplest way to test this with plain tools from the operating system (here OS X)? I'd imagine something like a good old…
Mike L.
- 5,617
- 16
- 50
- 69
19
votes
3 answers
Difference between localhost and the ip address
If bind a socket in Python to localhost,8200 this is accessible via http://localhost:8200/. but not http://x.x.x.x:8200/
If bind a socket in Python to x.x.x.x,8200, machinename,8200 this is accessible via http://x.x.x.x:8200/ and…
David
- 400
- 2
- 6
- 17
19
votes
1 answer
how to view haproxy status on the command line using a socket
In the examples, I have seen on the net
https://www.datadoghq.com/blog/how-to-collect-haproxy-metrics/#show-me-the-metrics
You can use the command line
echo "show stat" | nc -U /var/lib/haproxy/stats
Which is very ugly in the output. Columns…
nelaaro
- 13,149
- 30
- 84
- 111
14
votes
3 answers
Determining what process has bound a port (without listening) on Windows
If I want to find out what process is listening on what socket, I can use netstat/TCPview and will immediately see it. However, it is possible to bind to an address without listening. If this is done, it does not show up in netstat/TCPview, but does…
Jan Schejbal
- 1,112
- 9
- 14
14
votes
3 answers
Does Windows take care of closing sockets when processes exit?
I've read up this question about Linux, Can a port be bound when the process has terminated?
Linux appears to clean up after processes exiting, and leaving open sockets. I was wondering if there's any specification about how this works on…
Simone
- 242
- 2
- 6
13
votes
1 answer
How does the OS tell whether an "Address is already in use"?
If my C program uses sockets, binds to localhost:9025, exchanges some data, gets manually killed and restarted, it sometimes crashes with the error being:
Address already in use.
All SE-recommended software that I've tried to look for “pid that…
Captain Trojan
- 243
- 2
- 7
13
votes
1 answer
How to expose Linux socket file from Docker container (MySQL, MariaDB, etc.) to host
Disclaimer: I am not looking for a way to configure MySQL/MariaDB to use TCP connections. I am aware of that option and the question is not about that aspect.
I am having trouble binding a socket file from inside a container to the host file system.…
Torque
- 339
- 1
- 3
- 10
13
votes
2 answers
Connect a M.2 (B & M) key SSD into a B socket
I have bought a SSD with M.2 socket (B & M) key, but my computer just have a B key socket. My question is if I can connect the SSD in this B socket, and would it work correctly?
kimo pryvt
- 253
- 1
- 2
- 8