-2

Help me please

I'm trying to start Opentok video, i read all information, but i still can`t understand.

I started OpenTok API on heroky. And it's ok, but i don't understand how to start it on my server. I can't use heroky because of CORP error.

When I try to use heroky through a js script from example, I get a CORP error.(config.js is correct)
If I try to run the example from archiving php via sh run-demo, then it starts, but only on http, which constantly writes that an https connection is required for the camera and microphone to work.

Please help, please. I can’t understand how I can run this on https.

If I register a port in apache2, then when run-demo starts, a message appears stating that this port is already in use.

Trying to approach the problem from the other side, I tried to install the API on my server, specifying the path in apache2 to / web / index.php, but I only open the page as on heroky, but the methods themselves do not work.

Help me please. The fourth day in tears.

How i can start API on my own server or at least start archiving across run-demo?

On the main site it is completely incomprehensible written.
It is said just run on your server and not a word about https
I tried to watch the video on youtube, but there is also nothing about how to run on https.

Please help, good people.

Don't understand what i can add here to make help easier My run-demo file

#!/bin/sh

if [ -z "$TOKBOX_API_KEY" ] || [ -z "$TOKBOX_SECRET" ]
then
  export API_KEY=HereIUseMyKey
  export API_SECRET=HereIUseMySecretFromSite
fi

if [ -d "storage" ]
then
  rm -rf storage/
fi

php -S mysite.ru:8080 -t web/

Trying to start API on my server with this https://github.com/opentok/learning-opentok-php

CORP error getting with this example https://github.com/opentok/opentok-web-samples/tree/master/Archiving

Can't start php example archiving with https://github.com/opentok/OpenTok-PHP-SDK/tree/master/sample/Archiving using heroky

If something else can help please tell me, I’ll add right away

Katty
  • 1
  • 1
  • 1
    Welcome to Stackoverflow! Please update your question with the desired behavior, specific problems, and code to reproduce it. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – abestrad Jun 17 '20 at 14:00
  • Can you provide us some code please ? – Jonathan Delean Jun 17 '20 at 14:03
  • @JonathanDelean Please tell me what is worth adding? Which file? – Katty Jun 17 '20 at 14:09
  • I'm ready to add any information, but i don't know what will be usefull – Katty Jun 17 '20 at 14:15
  • If this can help someone with a similar problem, they helped a lot on the Russian stackover server. https://ru.stackoverflow.com/questions/1142732/opentok-install-api Only in addition to this, you still need to additionally register the key and sercet in app.json Thanks @DanielProtopopov and everyone who tried to help. It` working perfect. Good service, and good staff people. Thanks to Chris Tankersley very much. – Katty Jun 18 '20 at 15:45

1 Answers1

0

If I try to run the example from archiving php via sh run-demo, then it starts, but only on http, which constantly writes that an https connection is required for the camera and microphone to work.

Check that to enable you SSL (https) :

https://devcenter.heroku.com/articles/ssl

If I register a port in apache2, then when run-demo starts, a message appears stating that this port is already in use.

So change your config file and put an other port, or kill the process who use the port.

I started OpenTok API on heroky. And it's ok, but i don't understand how to start it on my server. I can't use heroky because of CORP error.

You request and you server need to enable CORP :

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type 

You ask too much question in your post, it's hard to help you.

Jonathan Delean
  • 1,011
  • 1
  • 8
  • 25
  • `Check that to enable you SSL (https)` it's enabled, but when i'm trying to send request from js there is CORP error. Header on my server not helps, cause it should be on requested server-heroky `has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource`. So change your config file and put an other port, or kill the process who use the port. - I try, but in this case it's starting on http I'm just want to start it on my server. There is just only one question. Rest is my attemptts. – Katty Jun 17 '20 at 14:45
  • Can u possibly help me pleeeease? Maybe i can try anything else? My main task is to run api on a server with an ssl certificate. I registered in apache2 the path to the file /web/index.php But it gives me an error that the server is not configured correctly. If I understood correctly, then because of the htaccess file. I tried to disable it, then it goes to the page, but the methods do not work. = ( I beg you, tell me, please, what am I doing wrong? – Katty Jun 18 '20 at 12:48
  • I want to help you but i dont know your precise error, you say us what you do but not what it's block you – Jonathan Delean Jun 18 '20 at 12:58
  • I added in apache2 way to directory `/var/www/mysite/opentok/web/` Downloaded https://github.com/opentok/learning-opentok-php and installed there. Launched composer. When i open my site i see page with methods https://pastenow.ru/6155583bf8928381f1ff23d674c0359f But methods not working. trying to call mysite.ru/session it says Not Found The requested URL was not found on this server. – Katty Jun 18 '20 at 13:05