aau-zid / BigBlueButton-liveStreaming

Streams a given BBB Meeting to an RTMP Server.
GNU General Public License v3.0
201 stars 160 forks source link

Chat problem #86

Closed Lutice closed 3 years ago

Lutice commented 4 years ago

Hello Thanks for your great job. I have a mistake with the chat functionnality . BBB is not on the same server as bbb-live-streaming. I redirect the redis port like this

ssh -L 6379:127.0.0.1:6379 -N -f ssh_user@bbb-server

If I don't do this Redis DB can't be join from outside because the default conf is 127.0.0.1 and I don't want to expose redis to everybody (I can use UFW but I prefer to keep it closed)

In the docker-compose.yml file I have this configuration :

      - BBB_ENABLE_CHAT=true
      - BBB_REDIS_HOST=127.0.0.1
      - BBB_REDIS_CHANNEL=chat
      - BBB_CHAT_NAME=chat

I have this error when I start the docker-compose

liveStreaming   | Traceback (most recent call last):
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 559, in connect
liveStreaming   |     sock = self._connect()
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 615, in _connect
liveStreaming   |     raise err
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 603, in _connect
liveStreaming   |     sock.connect(socket_address)
liveStreaming   | ConnectionRefusedError: [Errno 111] Connection refused
liveStreaming   | 
liveStreaming   | During handling of the above exception, another exception occurred:
liveStreaming   | 
liveStreaming   | Traceback (most recent call last):
liveStreaming   |   File "chat.py", line 120, in <module>
liveStreaming   |     bbb_browser()
liveStreaming   |   File "chat.py", line 78, in bbb_browser
liveStreaming   |     redis_s.psubscribe(**{args.channel:chat_handler})
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 3546, in psubscribe
liveStreaming   |     ret_val = self.execute_command('PSUBSCRIBE', *iterkeys(new_patterns))
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 3468, in execute_command
liveStreaming   |     self.shard_hint
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 1192, in get_connection
liveStreaming   |     connection.connect()
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 563, in connect
liveStreaming   |     raise ConnectionError(self._error_message(e))
liveStreaming   | redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused.

livestream from bbb-server

But I have the "same" problem if I start livestream from the bbb-server It's not connection refused but : name or service not known

liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 559, in connect
liveStreaming   |     sock = self._connect()
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 585, in _connect
liveStreaming   |     socket.SOCK_STREAM):
liveStreaming   |   File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
liveStreaming   |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
liveStreaming   | socket.gaierror: [Errno -2] Name or service not known
liveStreaming   | 
liveStreaming   | During handling of the above exception, another exception occurred:
liveStreaming   | 
liveStreaming   | Traceback (most recent call last):
liveStreaming   |   File "chat.py", line 123, in <module>
liveStreaming   |     bbb_browser()
liveStreaming   |   File "chat.py", line 80, in bbb_browser
liveStreaming   |     redis_s.psubscribe(**{args.channel:chat_handler})
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 3546, in psubscribe
liveStreaming   |     ret_val = self.execute_command('PSUBSCRIBE', *iterkeys(new_patterns))
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 3468, in execute_command
liveStreaming   |     self.shard_hint
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 1192, in get_connection
liveStreaming   |     connection.connect()
liveStreaming   |   File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 563, in connect
liveStreaming   |     raise ConnectionError(self._error_message(e))
liveStreaming   | redis.exceptions.ConnectionError: Error -2 connecting to redis:6379. Name or service not known.

I see this message : Viewers of the live stream can now send messages to this meeting but I disconnected immediately after

If someone can help me please :)

Regards Fabrice

mtsonline commented 3 years ago

hi Fabrice, could you solve your issue?

Lutice commented 3 years ago

hello @mtsonline no I don't

mtsonline commented 3 years ago

Fabrice I am not sure if you are trying the correct way ... what do you want to do?

the redis db is on the liveStreaming server and has nothing to do with the bbb server. The only external resource that will have to have access to the redis db is the player where the chat form is situated. you can open the port in the firewall for this server - or change the scripts to use authentication with redis. hth

Lutice commented 3 years ago

I thought the chat form could interact with the bbb-chat, it's not true ? I created a webpage with the livestream and the chat form. If the chat need a redis database to work standalone (without bbb) I need a redis container to run (it's not in the doc), but it's not what I wanted. Fabrice

mtsonline commented 3 years ago

Fabrice, the chat interacts with the bbb chat, but not via redis. The chat form sends the messages to a redis db hosted within a container. liveStreaming reads the messages from this db and sends it into the bbb chat via the website / html5 client it is logged into.

when you have a look at the docker-compose you will see that a redis db is included there and set to the same network so liveStreaming can interact with this db. all you have to do is set up the chat php script correctly and make sure the redis db (on the liveStreaming server can be reached from this form.

cheers

pawan-fls commented 3 years ago

Can anyone here guide how to "set up the chat php script correctly and make sure the redis db on the liveStreaming server can be reached from this form) ?