m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.96k stars 449 forks source link

Using External TURN Server: curious signaling ICE state #292

Closed ralfi closed 1 year ago

ralfi commented 1 year ago

Hi again, now

but ICE handling do not work because log file tells me

INF signaling state changed to have-local-offer module=webrtc submodule=pion subsystem=pc

and later

signal update - LocalCandidate id=STRING module=session

What i wrong and can i do to tell neko to handle ICE session with my coturn server?

m1k1o commented 1 year ago

Coturn configuration:

# TURN server name and realm
realm=example.com
server-name=turnserver

# Use fingerprint in TURN message
fingerprint

# IPs the TURN server listens to
listening-ip=0.0.0.0

# External IP-Address of the TURN server
external-ip=1.2.3.4

# Main listening port
listening-port=3478

# Further ports that are open for communication
min-port=10000
max-port=20000

# Log file path
log-file=stdout

# Enable verbose logging
verbose

# Specify the user for the TURN authentification
user=username:password

# Enable long-term credential mechanism
lt-cred-mech

# If running coturn version older than 4.5.2, uncomment these rules and ensure
# that you have listening-ip set to ipv4 addresses only.
# Prevent Loopback bypass https://github.com/coturn/coturn/security/advisories/GHSA-6g6j-r9rf-cm7p
#denied-peer-ip=0.0.0.0-0.255.255.255
#denied-peer-ip=127.0.0.0-127.255.255.255
#denied-peer-ip=::1

Neko NEKO_ICESERVERS configuration:

[{
    "urls": ["turn:1.2.3.4:3478?transport=udp", "turn:1.2.3.4:3478?transport=tcp"],
    "username": "username",
    "credential": "password"
}, {
    "urls": ["stun:stun.nextcloud.com:3478"]
}]

Full neko wokring example:

version: "3.4"
services:
  neko:
    image: "m1k1o/neko:firefox"
    restart: "unless-stopped"
    shm_size: "2gb"
    ports:
      - "8080:8080"
    environment:
      NEKO_SCREEN: 1920x1080@30
      NEKO_PASSWORD: neko
      NEKO_PASSWORD_ADMIN: admin
      NEKO_ICESERVERS: '[{"urls": ["turn:1.2.3.4:3478?transport=udp", "turn:1.2.3.4:3478?transport=tcp"], "username": "username", "credential": "password"}, {"urls": ["stun:stun.nextcloud.com:3478"]}]'

Make sure you don't use NEKO_ICELITE: true because ICE LITE does not use turn servers.

ralfi commented 1 year ago

Thanks! Works smooth. No sooner do you do it right then it works...