Community discussions

MikroTik App
 
sa7bnt
just joined
Topic Author
Posts: 4
Joined: Wed Jan 18, 2023 8:31 am

Problem with Websocket [SOLVED]

Mon Jan 30, 2023 9:26 am

Hallo @all
Im running my first MikroTik hAP AX3, and running in to a problem.

In my local network I am running an Apache2 (192.168.5.21) who has a reverse Proxy to 192.168.5.25 in his cfg
ProxyPass "/" http://192.168.5.25:8000/
ProxyPass "/wss/" "wss://192.168.5.25:5678/"
ProxyPassReverse "/" http://192.168.5.25:8000/
ProxyPassReverse "/wss/" "wss://192.168.5.25:5678/"
Include /etc/letsencrypt/options-ssl-apache.conf

My problem is if I am connecting the Website (from WAN) the wss is not sending data to the Apache2.
(output from DevTools browser Console)
(index):436 WebSocket connection to 'wss://exemple.com:5678/SYSINFO' failed:
(anonymous) @ (index):436
(index):442 WebSocket connection to 'wss://exemple.com:5678/MMDVM' failed:
(anonymous) @ (index):442
(index):471 WebSocket connection to 'wss://exemple.com:5678/DAPNET' failed:
(anonymous) @ (index):471
(index):479 WebSocket connection to 'wss://exemple.com:5678/SERVICES' failed:

On the hAP AX3 I am running
viewtopic.php?t=172380
Which also seems to work with other Port FW

For the Apache2 i add this NAT
[admin@MikroTik] > ip firewall nat print
Flags: X - disabled, I - invalid; D - dynamic
0 ;;; Hairpin NAT
chain=srcnat action=masquerade protocol=tcp src-address=192.168.5.0/24 dst-address=192.168.5.21 out-interface=bridge log=no log-prefix=""

1 ;;; defconf: masquerade
chain=srcnat action=masquerade out-interface-list=WAN log=no log-prefix="" ipsec-policy=out,none

2 chain=srcnat action=masquerade src-address=10.10.10.0/24 log=no log-prefix=""

3 ;;; Port forward: Apache2 (HTTP)
chain=dstnat action=dst-nat to-addresses=192.168.5.21 to-ports=80 protocol=tcp dst-address-list=WANs dst-port=80 log=no log-prefix=""

4 ;;; Port forward: Apache2 (HTTPS)
chain=dstnat action=dst-nat to-addresses=192.168.5.21 to-ports=443 protocol=tcp dst-address-list=WANs dst-port=443 log=no log-prefix=""

5 ;;; Port forward: Dashboard
chain=dstnat action=dst-nat to-addresses=192.168.5.21 to-ports=8000 protocol=tcp dst-address-list=WANs dst-port=8000 log=no log-prefix=""

6 ;;; Port forward: WebSocket
chain=dstnat action=dst-nat to-addresses=192.168.5.21 to-ports=5678 protocol=tcp dst-address-list=WANs dst-port=5678 log=no log-prefix=""

When I am switch back to my old router (Fritzbox) all is working fine. So it seems not to be related to the Apache2 reverse proxy but a configuration in the MikroTik which I still have wrong.
Should be nice to get some help for my problem.

Best
Tim

Who is online

Users browsing this forum: No registered users and 8 guests