mirror of
https://github.com/MetaProvide/talked-client.git
synced 2025-04-06 22:08:49 +00:00
Remove unix:// syntax to improve maintainability and document that abstract socket aren't supported. Fixes #9 (#12)
This commit is contained in:
parent
4c1af354c4
commit
d0085d3c9a
3 changed files with 10 additions and 9 deletions
|
@ -44,7 +44,9 @@ After you have registered the Talk command you should configure Talked. If you h
|
|||
|
||||
The http / https should be included in the url, for example: https://talked.example.com
|
||||
|
||||
You can also connect to the Talked server over a unix socket. To specify the path to a unix socket prefix the path with unix: or unix://.
|
||||
You can also connect to the Talked server over a unix socket. To specify the path to a unix socket prefix the path with `unix:` for example: `unix:/tmp/talked.sock`.
|
||||
|
||||
Please note that abstract sockets aren't supported.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -47,10 +47,14 @@ occ talk:command:add recording Talked "php /var/www/html/occ talked:record {ROOM
|
|||
|
||||
### Configuring Talked
|
||||
|
||||
After you have registered the Talk command you should configure Talked. If you head to Admin settings > Talk, then you will find the settings for Talked near the bottom. Here you can specify the URL for your Talked server and whether to use HTTP Basic auth, and the credentials for HTTP Basic auth.
|
||||
After you have registered the Talk command you should configure Talked. If you head to Admin settings > Talk, then you will find the settings for Talked near the bottom. Here you can specify the URI for your Talked server and whether to use HTTP Basic auth, and the credentials for HTTP Basic auth.
|
||||
|
||||
The http / https should be included in the url, for example: https://talked.example.com
|
||||
|
||||
You can also connect to the Talked server over a unix socket. To specify the path to a unix socket prefix the path with `unix:` for example: `unix:/tmp/talked.sock`.
|
||||
|
||||
Please note that abstract sockets aren't supported.
|
||||
|
||||
## Usage
|
||||
|
||||
To use Talked, simply use the `/recording` command in a chat room. If you don't specify any options or run `/recording help` you will get a help message telling you about the different options. The following options are available:
|
||||
|
|
|
@ -216,17 +216,12 @@ You have the following options available:
|
|||
protected function configureServerUri($curlHandle, string $serverUrl, string $endpoint) {
|
||||
# Check if the URI is pointing to a unix socket
|
||||
if (substr($serverUrl, 0, 5) === "unix:") {
|
||||
# Check if the URI is using long form (unix://) or short form (unix:)
|
||||
if (substr($serverUrl, 6, 1) === "/") {
|
||||
curl_setopt($curlHandle, CURLOPT_UNIX_SOCKET_PATH, substr($serverUrl, 7));
|
||||
} else {
|
||||
curl_setopt($curlHandle, CURLOPT_UNIX_SOCKET_PATH, substr($serverUrl, 5));
|
||||
}
|
||||
curl_setopt($curlHandle, CURLOPT_UNIX_SOCKET_PATH, substr($serverUrl, 5));
|
||||
# Configure the URL the requests should go to. In later versions
|
||||
# curl requires a dummy hostname, so here we just specify localhost.
|
||||
curl_setopt($curlHandle, CURLOPT_URL, "http://localhost" . '/' . $endpoint);
|
||||
} else {
|
||||
# If the URI isn't pointing to a unix socket, assume we are connecting over standard TCP
|
||||
# If the URI isn't pointing to a unix socket, assume we are connecting over TCP
|
||||
curl_setopt($curlHandle, CURLOPT_URL, $serverUrl . '/' . $endpoint);
|
||||
}
|
||||
return $curlHandle;
|
||||
|
|
Loading…
Add table
Reference in a new issue