socat server

This commit is contained in:
Shihaam Abdul Rahman 2023-10-04 01:14:27 +05:00
parent e542a91b9d
commit 950ddab4fd
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636
4 changed files with 10 additions and 4 deletions

View File

@ -18,7 +18,8 @@ services:
environment:
- DISPLAY # For GUI access
- XDG_OPEN_LISTENER_PORT=6969 # Set this to port number of socat server
- XDG_OPEN_LISTENER_HOST=192.168.x.x # set this to your host machine IP
extra_hosts:
- docker.host:192.168.x.x # set this to your host machine IP
devices:
- /dev/snd:/dev/snd # Mic and Speaker support
- /dev/video0:/dev/video0 # Webcam support
@ -39,6 +40,6 @@ Telegram cannot open links from the container to host machine, and to work aroun
#!/bin/bash
XDG_OPEN_LISTENER_PORT-6969
socat TCP-LISTEN:$XDG_OPEN_LISTENER_PORT,fork EXEC:"xargs -n 1 xdg-open"`
socat TCP-LISTEN:$XDG_OPEN_LISTENER_PORT,fork EXEC:"xargs -n 1 xdg-open"
```
k, thanks, bye

View File

@ -8,7 +8,8 @@ services:
environment:
- DISPLAY # For GUI access
- XDG_OPEN_LISTENER_PORT=6969 # Set this to port number of socat server
- XDG_OPEN_LISTENER_HOST=192.168.x.x # set this to your host machine IP
extra_hosts:
- docker.host:192.168.x.xx # set this to your host machine IP
devices:
- /dev/snd:/dev/snd # Mic and Speaker support
- /dev/video0:/dev/video0 # Webcam support

4
socat-server.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
XDG_OPEN_LISTENER_PORT-6969
socat TCP-LISTEN:$XDG_OPEN_LISTENER_PORT,fork EXEC:"xargs -n 1 xdg-open"

View File

@ -1,3 +1,3 @@
#!/bin/bash
echo $1 | socat - TCP:$XDG_OPEN_LISTENER_HOST:$XDG_OPEN_LISTENER_PORT
echo $1 | socat - TCP:docker.host:$XDG_OPEN_LISTENER_PORT