Join links
Join links can be shared as QR codes or URLs. They contain the server URL, allowing users to connect without entering the address manually.
When a join link is scanned or clicked, it first attempts to open the server in the app. If the app is not installed, it opens the server in the web app instead.
If the server cannot be reached, the user sees an error message.
Format
The format of a join link is as follows:
https://skapersok.no/join?url=<url_encoded_server_url>
Here, <url_encoded_server_url> is the server URL encoded so it can safely be used as a query parameter.
For example, if the server is running on:
http://10.0.2.2:5000
The join link will be:
https://skapersok.no/join?url=http%3A%2F%2F10.0.2.2%3A5000
URL encoding
The server URL must be URL-encoded before it is placed in a join link. You can use a programming library to do this safely.
For example, in Python, you can use the urllib.parse module:
import urllib.parse
server_url = "http://10.0.2.2:5000"
encoded_url = urllib.parse.quote(server_url, safe="")
print(encoded_url)
# Output: http%3A%2F%2F10.0.2.2%3A5000
Alternatively, when constructing the full join link, urlencode() can be used to automatically encode the query parameter:
import urllib.parse
server_url = "http://10.0.2.2:5000"
join_link = "https://skapersok.no/join?" + urllib.parse.urlencode({
"url": server_url
})
print(join_link)
# Output: https://skapersok.no/join?url=http%3A%2F%2F10.0.2.2%3A5000