Picture of iqbal
Registered 5 years 279 days
iqbal Thursday, 28 May 2020, 08:33 AM
Websocket connection to App on App Manager
I want to connect to App on App Manager via websocket. I followed app connection steps from this forum post:
http://forum.innovaphone.com/moodle2/mod/forum/discuss.php?d=25314#p68406

I followed your instructions, but still getting error. can you help me to figure it out. here some php code:

$uri = "wss://IPADDRESS/DOMAIN/usersapp";
$websocket = new AppPlatform\WSClient($sourcename, $uri);

$res = $this->sendMessage(new AppPlatform\Message("AppChallenge","app","users-admin"));
--> wenn i change "AppChallenge" to "Challenge" as in your documentation, i get requesttimeout.

if(property_exists($res,'challenge'))
{
$this->setSessionKey(hash('sha256', "users-admin:DemoUser:{$res->challenge}:DemoPassword"));
$this->setLoginMessage(new AppPlatform\Message("AppLogin", "app", "users-admin", "user", "DemoUser", "key", $this->getSessionKey()));
--> same wenn i change "AppLogin" to "Login" as in your documentation, i get requesttimeout.

$loginMsg = $this->sendMessage($this->getLoginMessage());
var_dump($loginMsg);
}

Answer that i get is as followed, see txt File:
result.txt
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Thursday, 28 May 2020, 09:17 AM
Re: Websocket connection to App on App Manager
Hi Igbal,

why didn't you replace IPADDRESS with the real IP address of your AP and DOMAIN with the real domain of your App Instance?

You can open the AP Manager, select the users app on the left side, select the users instance on the right side and click Edit at the top. Here you'll see the complete correct URL, e.g.:
http://192.168.1.100/domain.com/usersapp/innovaphone-users

You'll just replace http with wss and remove /innovaphone-users from the end for the App Websocket connection.

Greetings,
Daniel
← You can define your color theme preference here