commit fcad6b29a2e6b54b2699d389fbb24aab5a8a9125 from: jrmu date: Fri Mar 22 04:00:44 2024 UTC Daily backup commit - 75bfbd5a8a116deadadead96f3c53d057fce4420 commit + fcad6b29a2e6b54b2699d389fbb24aab5a8a9125 blob - /dev/null blob + 46a5697f1c963b445ac6a82f057c275249447942 (mode 644) --- /dev/null +++ wiki.d/Relayd.Wss @@ -0,0 +1,20 @@ +version=pmwiki-2.3.20 ordered=1 urlencoded=1 +agent=w3m/0.5.3+git20230121 +author=jrmu +charset=UTF-8 +csum=Thanks to miniontoby! +ctime=1710963755 +host=104.167.242.140 +name=Relayd.Wss +rev=2 +targets=Relayd.Acceleration +text=!! Relayd with WSS%0a%0aSome apps, mostly like multiplayer games, are running on a port and need an websocket.%0a%0aMost of the time you would want to put it on a subdomain, but then the websocket should still go on a port, but the software doesn't allow it, since it polls using http first and then connects to websocket and they just cannot be seperate ports.%0a%0aThis is why you should add these things to your relayd.conf%0a%0a%0a!!! Instructions%0a%0aWe assume your relayd.conf looks like this:%0a[@%0ahttp protocol https {%0a match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a match request header append "X-Forwarded-By" \%0a value "$SERVER_ADDR:$SERVER_PORT"%0a match request header set "Connection" value "close"%0a tcp { sack, backlog 128 }%0a tls { keypair service1.example.com }%0a tls { keypair service2.example.com }%0a match request header "Host" value "service1.example.com" forward to %3cservice1>%0a match request header "Host" value "service2.example.com" forward to %3cservice2>%0a}%0a@]%0aP.s. this is the config from [[Relayd.Acceleration]]%0a%0aNow, in order to add support for websockets, just add these lines before the [@tcp { sack, backlog 128 }@] line%0a%0a[@%0a match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a http websockets%0a@]%0a%0aThis would result into:%0a[@%0ahttp protocol https {%0a match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a match request header append "X-Forwarded-By" \%0a value "$SERVER_ADDR:$SERVER_PORT"%0a match request header set "Connection" value "close"%0a match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a http websockets%0a tcp { sack, backlog 128 }%0a tls { keypair service1.example.com }%0a tls { keypair service2.example.com }%0a match request header "Host" value "service1.example.com" forward to %3cservice1>%0a match request header "Host" value "service2.example.com" forward to %3cservice2>%0a}%0a@]%0a%0aNow reload your relayd using [@doas rcctl reload relayd@] and you should be good to go! +time=1710972788 +author:1710972788=jrmu +csum:1710972788=Thanks to miniontoby! +diff:1710972788:1710963755:= +host:1710972788=104.167.242.140 +author:1710963755=miniontoby +csum:1710963755=Initial instructions +diff:1710963755:1710963755:=1,52d0%0a%3c !! Relayd with WSS%0a%3c %0a%3c Some apps, mostly like multiplayer games, are running on a port and need an websocket.%0a%3c %0a%3c Most of the time you would want to put it on a subdomain, but then the websocket should still go on a port, but the software doesn't allow it, since it polls using http first and then connects to websocket and they just cannot be seperate ports.%0a%3c %0a%3c This is why you should add these things to your relayd.conf%0a%3c %0a%3c %0a%3c !!! Instructions%0a%3c %0a%3c We assume your relayd.conf looks like this:%0a%3c [@%0a%3c http protocol https {%0a%3c match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a%3c match request header append "X-Forwarded-By" \%0a%3c value "$SERVER_ADDR:$SERVER_PORT"%0a%3c match request header set "Connection" value "close"%0a%3c tcp { sack, backlog 128 }%0a%3c tls { keypair service1.example.com }%0a%3c tls { keypair service2.example.com }%0a%3c match request header "Host" value "service1.example.com" forward to %3cservice1>%0a%3c match request header "Host" value "service2.example.com" forward to %3cservice2>%0a%3c }%0a%3c @]%0a%3c P.s. this is the config from [[Relayd.Acceleration]]%0a%3c %0a%3c Now, in order to add support for websockets, just add these lines before the [@tcp { sack, backlog 128 }@] line%0a%3c %0a%3c [@%0a%3c match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a%3c http websockets%0a%3c @]%0a%3c %0a%3c This would result into:%0a%3c [@%0a%3c http protocol https {%0a%3c match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a%3c match request header append "X-Forwarded-By" \%0a%3c value "$SERVER_ADDR:$SERVER_PORT"%0a%3c match request header set "Connection" value "close"%0a%3c match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a%3c http websockets%0a%3c tcp { sack, backlog 128 }%0a%3c tls { keypair service1.example.com }%0a%3c tls { keypair service2.example.com }%0a%3c match request header "Host" value "service1.example.com" forward to %3cservice1>%0a%3c match request header "Host" value "service2.example.com" forward to %3cservice2>%0a%3c }%0a%3c @]%0a%3c %0a%3c Now reload your relayd using [@doas rcctl reload relayd@] and you should be good to go!%0a\ No newline at end of file%0a +host:1710963755=45.136.74.157 blob - /dev/null blob + 1cf3f55aabad0bd85209a07115045f94c16df4d7 (mode 644) --- /dev/null +++ wiki.d/Relayd.Wss-Draft,del-1710972788 @@ -0,0 +1,16 @@ +version=pmwiki-2.3.20 ordered=1 urlencoded=1 +agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 +author=miniontoby +charset=UTF-8 +csum=Initial instructions +ctime=1710963755 +host=45.136.74.157 +name=Relayd.Wss-Draft +rev=1 +targets=Relayd.Acceleration +text=!! Relayd with WSS%0a%0aSome apps, mostly like multiplayer games, are running on a port and need an websocket.%0a%0aMost of the time you would want to put it on a subdomain, but then the websocket should still go on a port, but the software doesn't allow it, since it polls using http first and then connects to websocket and they just cannot be seperate ports.%0a%0aThis is why you should add these things to your relayd.conf%0a%0a%0a!!! Instructions%0a%0aWe assume your relayd.conf looks like this:%0a[@%0ahttp protocol https {%0a match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a match request header append "X-Forwarded-By" \%0a value "$SERVER_ADDR:$SERVER_PORT"%0a match request header set "Connection" value "close"%0a tcp { sack, backlog 128 }%0a tls { keypair service1.example.com }%0a tls { keypair service2.example.com }%0a match request header "Host" value "service1.example.com" forward to %3cservice1>%0a match request header "Host" value "service2.example.com" forward to %3cservice2>%0a}%0a@]%0aP.s. this is the config from [[Relayd.Acceleration]]%0a%0aNow, in order to add support for websockets, just add these lines before the [@tcp { sack, backlog 128 }@] line%0a%0a[@%0a match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a http websockets%0a@]%0a%0aThis would result into:%0a[@%0ahttp protocol https {%0a match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a match request header append "X-Forwarded-By" \%0a value "$SERVER_ADDR:$SERVER_PORT"%0a match request header set "Connection" value "close"%0a match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a http websockets%0a tcp { sack, backlog 128 }%0a tls { keypair service1.example.com }%0a tls { keypair service2.example.com }%0a match request header "Host" value "service1.example.com" forward to %3cservice1>%0a match request header "Host" value "service2.example.com" forward to %3cservice2>%0a}%0a@]%0a%0aNow reload your relayd using [@doas rcctl reload relayd@] and you should be good to go! +time=1710963755 +author:1710963755=miniontoby +csum:1710963755=Initial instructions +diff:1710963755:1710963755:=1,52d0%0a%3c !! Relayd with WSS%0a%3c %0a%3c Some apps, mostly like multiplayer games, are running on a port and need an websocket.%0a%3c %0a%3c Most of the time you would want to put it on a subdomain, but then the websocket should still go on a port, but the software doesn't allow it, since it polls using http first and then connects to websocket and they just cannot be seperate ports.%0a%3c %0a%3c This is why you should add these things to your relayd.conf%0a%3c %0a%3c %0a%3c !!! Instructions%0a%3c %0a%3c We assume your relayd.conf looks like this:%0a%3c [@%0a%3c http protocol https {%0a%3c match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a%3c match request header append "X-Forwarded-By" \%0a%3c value "$SERVER_ADDR:$SERVER_PORT"%0a%3c match request header set "Connection" value "close"%0a%3c tcp { sack, backlog 128 }%0a%3c tls { keypair service1.example.com }%0a%3c tls { keypair service2.example.com }%0a%3c match request header "Host" value "service1.example.com" forward to %3cservice1>%0a%3c match request header "Host" value "service2.example.com" forward to %3cservice2>%0a%3c }%0a%3c @]%0a%3c P.s. this is the config from [[Relayd.Acceleration]]%0a%3c %0a%3c Now, in order to add support for websockets, just add these lines before the [@tcp { sack, backlog 128 }@] line%0a%3c %0a%3c [@%0a%3c match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a%3c http websockets%0a%3c @]%0a%3c %0a%3c This would result into:%0a%3c [@%0a%3c http protocol https {%0a%3c match request header append "X-Forwarded-For" value "$REMOTE_ADDR"%0a%3c match request header append "X-Forwarded-By" \%0a%3c value "$SERVER_ADDR:$SERVER_PORT"%0a%3c match request header set "Connection" value "close"%0a%3c match request header "Upgrade" value "websocket" header set "Connection" value "upgrade"%0a%3c http websockets%0a%3c tcp { sack, backlog 128 }%0a%3c tls { keypair service1.example.com }%0a%3c tls { keypair service2.example.com }%0a%3c match request header "Host" value "service1.example.com" forward to %3cservice1>%0a%3c match request header "Host" value "service2.example.com" forward to %3cservice2>%0a%3c }%0a%3c @]%0a%3c %0a%3c Now reload your relayd using [@doas rcctl reload relayd@] and you should be good to go!%0a\ No newline at end of file%0a +host:1710963755=45.136.74.157