New to this? Read How Socketchat works first.
Forward the port
1
Give the server a fixed local address
Reserve the server’s local IP in your router, as described in Keep the address from changing. Port forwarding points at that address.
2
Add a port forwarding rule
Routers differ, but the steps look like this:
- Open your router’s admin page, often at
192.168.1.1or192.168.0.1, or the router maker’s phone app. - Find Port forwarding. It may sit under NAT, Firewall, Advanced or Virtual servers.
- Add a rule: protocol TCP, external port 7444, internal port 7444, internal IP the server’s local address.
- Save it.
3
Find your public IP address
Your public IP is shown on your router’s status page. You can also ask a website from any device at home:
4
Set up the server with your public address
Use your public IP, or better, a dynamic DNS name (below):Allow the firewall prompt on macOS or Windows, as on the Same Wi-Fi page.
5
Test from outside
Ask a friend to join with a
socketchat server invite link, or try from a phone hotspot with Wi-Fi off. Many routers cannot reach their own public address from inside the home, so a test from inside can fail even when everything works.If your public IP changes
Most home internet plans give you a dynamic IP: the provider can change your public address at any time, often when the router restarts. Members’ apps would then dial an address that no longer reaches you. Dynamic DNS (DDNS) fixes this. A DDNS service gives you a name, such asmyhome.duckdns.org, and a small program on your router or server tells the service your new address whenever it changes. Use that name for --host, and invite links keep working.
- DuckDNS is free and gives a name under
duckdns.org. - If you own a domain on Cloudflare, point a name such as
chat.example.comat your home and keep it updated with a DDNS client that uses the Cloudflare API. - Many routers have a built-in DDNS client under Dynamic DNS.
socketchat server init, because invite links carry it.
If port forwarding does not work: CGNAT
Some internet providers put many homes behind one shared public address. This is called CGNAT (carrier-grade NAT). Behind CGNAT, a port forwarding rule on your router does nothing, because the connection never reaches your router. To tell whether you are behind it, compare the WAN or internet address on your router’s status page with the addresscurl https://api.ipify.org prints:
- They match: you have your own public address, and port forwarding can work.
- They differ, or the router’s address starts with
100.64.to100.127.: you are probably behind CGNAT.