mirror of
https://github.com/dani/vroom.git
synced 2024-06-14 10:30:11 +02:00
Load Redis plugin
This commit is contained in:
parent
95efab95a4
commit
a7b90b2b6b
|
@ -3,6 +3,8 @@
|
|||
;dsn = 'DBI:mysql:database=devroom;host=localhost'
|
||||
;user = 'vroom'
|
||||
;password = 'password'
|
||||
; Redis server
|
||||
;redis = 'localhost:6379'
|
||||
|
||||
[turn]
|
||||
; The stun server sent to client. You can set it to your own stun server. Takes a comma separated list of full
|
||||
|
|
|
@ -17,6 +17,7 @@ sub get_conf(){
|
|||
$config->{'database.dsn'} ||= 'DBI:mysql:database=vroom;host=localhost';
|
||||
$config->{'database.user'} ||= 'vroom';
|
||||
$config->{'database.password'} ||= 'vroom';
|
||||
$config->{'database.redis'} ||= 'localhost:6379';
|
||||
$config->{'signaling.uri'} ||= 'https://vroom.example.com/';
|
||||
$config->{'turn.stun_server'} ||= 'stun.l.google.com:19302';
|
||||
$config->{'turn.turn_server'} ||= undef;
|
||||
|
|
9
vroom.pl
9
vroom.pl
|
@ -8,6 +8,7 @@ use lib 'lib';
|
|||
use Mojolicious::Lite;
|
||||
use Mojolicious::Plugin::Mail;
|
||||
use Mojolicious::Plugin::Database;
|
||||
use Mojolicious::Plugin::Redis;
|
||||
use Mojolicious::Plugin::StaticCompressor;
|
||||
use Vroom::Constants;
|
||||
use Vroom::Conf;
|
||||
|
@ -100,6 +101,12 @@ plugin database => {
|
|||
}
|
||||
};
|
||||
|
||||
# Connect to redis
|
||||
plugin redis =>{
|
||||
serveur => $config->{'database.redis'},
|
||||
helper => 'redis'
|
||||
};
|
||||
|
||||
# Load mail plugin with its default values
|
||||
plugin mail => {
|
||||
from => $config->{'email.from'},
|
||||
|
@ -1233,7 +1240,7 @@ get '/socket.io/:ver' => sub {
|
|||
# WebSocket transport for the Socket.IO channel
|
||||
websocket '/socket.io/:ver/websocket/:id' => sub {
|
||||
my $self = shift;
|
||||
my $id = $self->stash('id');
|
||||
my $id = $self->stash('id');
|
||||
# the ID must match the one stored in our session
|
||||
if ($id ne $self->session('peer_id')){
|
||||
$self->log_event({
|
||||
|
|
Loading…
Reference in New Issue
Block a user