{{Header}} {{#seo: |description=Redirect ports or unix domain socket files from {{project_name_gateway_long}} localhost to {{project_name_workstation_long}}. |image=Redirect12123.png }} [[image:Redirect12123.png|thumb]] {{intro| Redirect ports or unix domain socket files from {{project_name_workstation_short}} localhost to {{project_name_gateway_short}}. }} = Introduction = Port or unix domain socket file redirection could be useful for any future applications that expect Tor or the ControlPort to listen on any specific port or unix domain socket file that is not (yet) added to [[Dev/anon-ws-disable-stacked-tor|anon-ws-disable-stacked-tor]] [https://github.com/Whonix/anon-ws-disable-stacked-tor/blob/master/usr/libexec/anon-ws-disable-stacked-tor/systemd-unit-files-generator#L20 build-ins] or c[https://github.com/{{project_name_short}}/anon-ws-disable-stacked-tor/blob/master/etc/anon-ws-disable-stacked-tor.d/30_anon-dist.conf onfig] by default, or for any other port or unix domain socket file redirections from the workstation to the gateway. = Instructions = To create a port or unix domain socket file, it is required to create and extend config file /etc/anon-ws-disable-stacked-tor.d/50_user.conf. https://github.com/{{project_name_short}}/anon-ws-disable-stacked-tor/blob/master/etc/anon-ws-disable-stacked-tor.d/30_anon-dist.conf '''1.''' Inside {{project_name_workstation_short}}. '''2.''' Platform specific notice. * {{non_q_project_name_long}}: No special notice. * {{q_project_name_long}}: users should use folder /etc/anon-ws-disable-stacked-tor.d rather than folder /usr/local/etc/anon-ws-disable-stacked-tor.d/ and apply this in {{project_name_workstation_template}} Template. The missing Qubes-Whonix feature is that /usr/libexec/anon-ws-disable-stacked-tor/systemd-unit-files-generator doesn't run at boot time and that files generated by /usr/libexec/anon-ws-disable-stacked-tor/systemd-unit-files-generator don't persist after reboot of a TemplateBasedVM. '''3.''' Create folder /usr/local/etc/anon-ws-disable-stacked-tor.d/. {{CodeSelect|code= sudo mkdir -p /usr/local/etc/anon-ws-disable-stacked-tor.d }} '''4.''' {{Open with root rights|filename= /usr/local/etc/anon-ws-disable-stacked-tor.d/50_user.conf }} '''5.''' Port redirection or unix domain socket file redirection. '''A)''' Either add a port redirection. For example to redirect {{project_name_workstation_short}} port 9100 to {{project_name_gateway_short}} port 9050. Note: adjust the port numbers for your needs. {{CodeSelect|code= file_port_tuples+=" port#9100:9050 " }} '''B)''' Unix domain socket file redirection. Create a unix domain socket file /var/run/anon-ws-disable-stacked-tor/unix-domain-socket-file.sock and have it forwarded to {{project_name_gateway_short}} port 9050. {{CodeSelect|code= file_port_tuples+=" /var/run/anon-ws-disable-stacked-tor/unix-domain-socket-file.sock#9050 " }} '''6.''' Save. '''7.''' Run the systemd-socket-proxyd systemd-unit-files-generator. https://github.com/Whonix/anon-ws-disable-stacked-tor/blob/master/usr/libexec/anon-ws-disable-stacked-tor/systemd-unit-files-generator {{CodeSelect|code= sudo /usr/libexec/anon-ws-disable-stacked-tor/systemd-unit-files-generator }} '''8.''' Done. The process of creating a redirection is now complete. = Testing = To test /var/run/anon-ws-disable-stacked-tor/unix-domain-socket-file.sock, you could use: {{CodeSelect|code= socat - UNIX-CONNECT:/var/run/anon-ws-disable-stacked-tor/unix-domain-socket-file.sock }} Then type: {{CodeSelect|code= GET }} Then press . The expected reply includes Tor is not an HTTP Proxy. = Footnotes = {{reflist|close=1}} [[Category:Documentation]] {{Footer}}