blob: f88ef879c53c45df39c1e4c8c854e32b4df35855 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
.TH UINPUTD 8 2018-07-04 Linux
.SH NAME
uinputd
.SH SYNOPSIS
.B uinputd
.SH DESCRIPTION
.B uinputd
exposes uinput over a pipe allowing clients such as
.BR linux-uinput (1)
to present a local device and have uinput emulate it.
.P
While it is not much use on the same machine, when combined with tools like
.BR socat (1)
or
.BR tcpserver (1)
and
.BR netcat (1)
it can allow for network transparent device emulation from the remote client to
the host.
.SH NOTES
Due to how
.B uinputd
is implemented, the clients may not be compatible with different kind of hosts.
.SH EXAMPLE
.SS Using tcpserver (ucspi-tcp) and netcat
On the the host
.B uinputd
can be launched with
.BR tcpserver (1)
when incomming TCP connections on port 5000 are received.
.P
.RS
.EX
# tcpserver 0.0.0.0 5000 uinputd
.EE
.RE
.P
Then on the client
.BR linux-uinput (1)
can be used to pass a local device to the remote's
.I address
on port 5000.
.P
.RS
.EX
# linux-uinput /dev/input/event4 | nc $address 5000
.EE
.RE
.SS Using socat
Much like the the above example using
.BR tcpserver (1)
and
.BR tcpclient (1),
the host runs a
.BR socat (1)
command which forks off a new
.B uinputd
server when receiving connections.
.P
.RS
.EX
# socat tcp-listen:5000,reuseaddr,fork exec:uinputd
.EE
.RE
.P
Likewise for the client
.P
.RS
.EX
# linux-uinput /dev/input/event4 | socat - tcp:$address:5000
.EE
.RE
.SH SOURCE
.UR https://git.cloudef.pw/uinputd.git
.UE
.SH SEE ALSO
.BR linux-uinput (1),
.BR socat (1),
.BR nc (1)
.P
.UR https://cr.yp.to/ucspi-tcp.html
.UE
.P
.UR https://www.kernel.org/doc/html/latest/input/uinput.html
.UE
|