> ## Documentation Index
> Fetch the complete documentation index at: https://docs.link4sync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connections

> HTTPS, HTTP, MQTT, and MQTTS: when to use each one, their addresses, and how to authenticate.

Pick the protocol that fits each device or service. The topic card shows the address and credentials for every one.

| Protocol | Best for | Authentication | Encrypted |
| - | - | - | - |
| **HTTPS** | Backend services (the default) | Login token (OAuth) or SCRAM-SHA-256 | Yes, TLS |
| **HTTP** | Clients that cannot use TLS | SCRAM-SHA-256 | No |
| **MQTT** | Devices and browsers | Access token or SCRAM-SHA-512 | Yes, WSS |
| **MQTTS** | Devices with a native MQTT stack | Access token or SCRAM-SHA-512 | Yes, TLS |

> [!WARNING]
>
> HTTP traffic is not encrypted. Prefer HTTPS or MQTTS whenever you can.

## Addresses

| Protocol | Basic (shared) | Premium (owned) |
| - | - | - |
| HTTPS | `https://<endpoint>.link4sync.com/<topic>` | Same pattern, your own endpoint |
| HTTP | `http://<endpoint>-http.link4sync.com/<topic>` | Same pattern, your own endpoint |
| MQTT over WebSocket | `wss://mqtt.link4sync.com/mqtt` | `wss://<instance>-mqtt.link4sync.com/mqtt` |
| MQTTS | `mqtts://mqtt.link4sync.com:8883` | `mqtts://<instance>-mqtts.link4sync.com:443` |

> [!TIP]
>
> Always use the exact URL from the topic card. The HTTP and HTTPS path is the topic name shown
> there, while MQTT clients publish to the **topic ID**.

## Publish and read

| Connection | Publish | Read |
| - | - | - |
| HTTPS, HTTP | `POST` to the connection URL | Not available |
| MQTT, MQTTS | Publish to `<topic ID>` | Subscribe to `<topic ID>/out` |

To read a topic, use MQTT even if you publish over HTTPS. See [Read messages](https://docs.link4sync.com/en/read-messages.md).

## Next steps

> [card] [HTTPS with OAuth](https://docs.link4sync.com/en/publish/https-oauth.md)
>
> Publish with a token from your login.

> [card] [HTTP(S) with SCRAM](https://docs.link4sync.com/en/publish/http-scram.md)
>
> Publish with the producer credential.

> [card] [Publish over MQTT](https://docs.link4sync.com/en/publish/mqtt.md)
>
> Connect devices and browsers.

> [card] [Read messages](https://docs.link4sync.com/en/read-messages.md)
>
> Subscribe to the topic ID with /out.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.