mirror of https://github.com/OpenVidu/openvidu.git
Trying an advanced secure app demo is a piece of cake now
parent
b1e436d143
commit
a640d3da07
22
README.md
22
README.md
|
@ -220,6 +220,26 @@ String token = session.generateToken();
|
||||||
|
|
||||||
> Communication between _Your Back_ and _openvidu-server_ modules is outlined in the diagram, but it does not correspond to the real methods. Remember you can handle this from your backend by consuming the [REST API](#rest-api) or by using _openvidu-backend-client_ package.
|
> Communication between _Your Back_ and _openvidu-server_ modules is outlined in the diagram, but it does not correspond to the real methods. Remember you can handle this from your backend by consuming the [REST API](#rest-api) or by using _openvidu-backend-client_ package.
|
||||||
|
|
||||||
|
|
||||||
|
## A sample advanced app
|
||||||
|
Wanna try a real sample application that makes use of everything we have talked about? Take a look at this app. It wraps a backend built with Spring and a MySQL database:
|
||||||
|
|
||||||
|
- Please be sure that you have docker-compose (`sudo apt-get install docker-compose`)
|
||||||
|
- Download the `docker-compose.yml` file and run it:
|
||||||
|
|
||||||
|
```
|
||||||
|
wget -O docker-compose.yml https://raw.githubusercontent.com/OpenVidu/openvidu-docker/master/openvidu-sample-app/docker-compose.yml
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
- Wait until you see an output like `Started App in 13.986 seconds (JVM running for 15.501)`
|
||||||
|
|
||||||
|
- Go to [`https://localhost:8443`](https://localhost:8443) and accept the self-signed certificate. Then you can access the app through [`http://localhost:5000`](http://localhost:5000). Here you have a couple registered users (use a standard window and an incognito window to test both of them at the same time):
|
||||||
|
|
||||||
|
| user | password |
|
||||||
|
| -------------------------- | ----------- |
|
||||||
|
| teacher@<span></span>gmail.com | pass |
|
||||||
|
| student1@<span></span>gmail.com | pass |
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
||||||
|
@ -408,7 +428,7 @@ Here you have a step by step guide to deploy a production version of OpenVidu in
|
||||||
|
|
||||||
7. Init openvidu-server Docker container (securization enabled)
|
7. Init openvidu-server Docker container (securization enabled)
|
||||||
|
|
||||||
```bash
|
```
|
||||||
sudo docker run -d -p 8443:8443 -e openvidu.security=true -e openvidu.secret=YOUR_SECRET -e kms.uris=[\"ws://YOUR_MACHINE'S_INTERNAL_IP:8888/kurento\"] openvidu/openvidu-server
|
sudo docker run -d -p 8443:8443 -e openvidu.security=true -e openvidu.secret=YOUR_SECRET -e kms.uris=[\"ws://YOUR_MACHINE'S_INTERNAL_IP:8888/kurento\"] openvidu/openvidu-server
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -39,12 +39,12 @@ public class SessionController {
|
||||||
private Map<Long, Session> lessonIdSession = new ConcurrentHashMap<>();
|
private Map<Long, Session> lessonIdSession = new ConcurrentHashMap<>();
|
||||||
private Map<String, Map<Long, String>> sessionIdUserIdToken = new ConcurrentHashMap<>();
|
private Map<String, Map<Long, String>> sessionIdUserIdToken = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private final String OPENVIDU_URL = "https://localhost:8443/";
|
private String OPENVIDU_URL;
|
||||||
|
|
||||||
private String SECRET;
|
private String SECRET;
|
||||||
|
|
||||||
public SessionController(@Value("${openvidu.secret}") String secret){
|
public SessionController(@Value("${openvidu.secret}") String secret, @Value("${openvidu.url}") String openviduUrl){
|
||||||
this.SECRET = secret;
|
this.SECRET = secret;
|
||||||
|
this.OPENVIDU_URL = openviduUrl;
|
||||||
this.openVidu = new OpenVidu(OPENVIDU_URL, SECRET);
|
this.openVidu = new OpenVidu(OPENVIDU_URL, SECRET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
spring.profiles.active=container
|
||||||
|
|
||||||
|
server.port: 5000
|
||||||
|
|
||||||
|
spring.datasource.url: jdbc:mysql://mysql:3306/openvidu_sample_app
|
||||||
|
spring.datasource.username: op-root
|
||||||
|
spring.datasource.password: pass
|
||||||
|
spring.datasource.driverClassName: com.mysql.jdbc.Driver
|
||||||
|
spring.datasource.platform: mysql
|
||||||
|
spring.jpa.database: MYSQL
|
||||||
|
spring.jpa.hibernate.ddl-auto: create-drop
|
||||||
|
|
||||||
|
openvidu.url: https://service-openvidu-server-kms:8443/
|
||||||
|
openvidu.secret: MY_SECRET
|
||||||
|
|
|
@ -7,4 +7,5 @@ spring.datasource.driverClassName: com.mysql.jdbc.Driver
|
||||||
spring.jpa.database: MYSQL
|
spring.jpa.database: MYSQL
|
||||||
spring.jpa.hibernate.ddl-auto: create-drop
|
spring.jpa.hibernate.ddl-auto: create-drop
|
||||||
|
|
||||||
|
openvidu.url: https://localhost:8443/
|
||||||
openvidu.secret: MY_SECRET
|
openvidu.secret: MY_SECRET
|
||||||
|
|
Loading…
Reference in New Issue