screego / server

screen sharing for developers https://screego.net/
https://app.screego.net
GNU General Public License v3.0
7.77k stars 557 forks source link

failed to handle Refresh-request #193

Closed NepPure closed 2 months ago

NepPure commented 2 months ago

198.18.7.0/24 is VPN sub net.

2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.Join id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Send event=room id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Send event=room id=cr09226p2o7s73ahg070 ip=198.18.7.3
2024-08-17T12:04:08Z DBG WebSocket Send event=room id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Send event=hostsession id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Send event=clientsession id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.HostOffer id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.HostICE id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Send event=hostoffer id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Send event=hostice id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.HostICE id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Send event=hostice id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG TURN authenticated addr=198.18.7.9:53399 realm=screego
2024-08-17T12:04:08Z DBG TURN allocated addr=[::]:50042 relayaddr=198.18.7.16:50042
2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.HostICE id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Send event=hostice id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.ClientAnswer id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Send event=clientanswer id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:08Z DBG WebSocket Receive event=*ws.ClientICE id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:08Z DBG WebSocket Send event=clientice id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:09Z DBG TURN authenticated addr=198.18.7.6:40712 realm=screego
2024-08-17T12:04:09Z DBG TURN allocated addr=[::]:50014 relayaddr=198.18.7.16:50014
2024-08-17T12:04:09Z DBG TURN authenticated addr=198.18.7.6:40712 realm=screego
2024-08-17T12:04:09Z DBG WebSocket Receive event=*ws.ClientICE id=cr093e6p2o7s73ahg0a0 ip=198.18.7.6
2024-08-17T12:04:09Z DBG WebSocket Send event=clientice id=cr09206p2o7s73ahg06g ip=198.18.7.9
2024-08-17T12:04:09Z DBG TURN authenticated addr=198.18.7.9:53399 realm=screego
2024-08-17T12:04:13Z DBG TURN username not found addr={"IP":"198.18.7.9","Port":53360,"Zone":""} username=cr093bep2o7s73ahg09ghost
turn ERROR: 2024/08/17 12:04:13 Failed to handle datagram: failed to handle Refresh-request from 198.18.7.9:53360: no such user exists cr093bep2o7s73ahg09ghost
2024-08-17T12:04:24Z DBG TURN authenticated addr=198.18.7.6:40712 realm=screego
2024-08-17T12:04:24Z DBG TURN authenticated addr=198.18.7.9:53399 realm=screego

docker:

networks:
    1panel-network:
        external: true
services:
    screego:
        container_name: ${CONTAINER_NAME}
        deploy:
            resources:
                limits:
                    cpus: ${CPUS}
                    memory: ${MEMORY_LIMIT}
        environment:
            SCREEGO_EXTERNAL_IP: ${SCREEGO_EXTERNAL_IP}
            SCREEGO_TURN_PORT_RANGE: 50000:50200
            SCREEGO_AUTH_MODE: none
            SCREEGO_LOG_LEVEL: debug
            SCREEGO_USERS_FILE: data/user.txt
            SCREEGO_SECRET: nep
            SCREEGO_TRUST_PROXY_HEADERS: true
        image: ghcr.io/screego/server:1.10.4
        labels:
            createdBy: Apps
        networks:
            - 1panel-network
        volumes:
            - ./data:/data
        ports:
            - ${HOST_IP}:${PANEL_APP_PORT_HTTP}:5050
            - ${HOST_IP}:${PANEL_APP_PORT_TURN}:3478
            - ${HOST_IP}:${SCREEGO_TURN_PORT_RANGE}:50000-50200/udp
        restart: always

In addition, nginx reverse proxy provides SSL. I did not see any error when pressing F12 on the web page. I have no idea how to deal with this problem. I hope to get some suggestions

jmattheis commented 2 months ago

Do you experience any problems while viewing or sharing the screen?

NepPure commented 2 months ago

Do you experience any problems while viewing or sharing the screen?

Yes, after sharing the screen, the other subnet client opens the browser and nothing happens

jmattheis commented 2 months ago

please show the full log with only two clients in one room. Does https://app.screego.net work? What content does the variable SCREEGO_TURN_PORT_RANGE have. Is SCREEGO_EXTERNAL_IP an ip in the subnet?

NepPure commented 2 months ago

SCREEGO_TURN_PORT_RANGE is 50000-50200. SCREEGO_EXTERNAL_IP is an ip in the subnet.

PANEL_APP_PORT_HTTP=5050
PANEL_APP_PORT_TURN=3478
SCREEGO_EXTERNAL_IP="198.18.7.16"
SCREEGO_TURN_PORT_RANGE="50000-50200"

Full logs

The domain name resolution address in the log is subnet IP 198.18.7.16

screego-20240817233637.log

NepPure commented 2 months ago

image

49cc0d86fc122b2202671500b5417865_720

NepPure commented 2 months ago

https://app.screego.net

It's not work.

Because it is a self-built server in my VPN network, I hope to use TRUN. However, I can't see any problems from the logs. The websites and services built by other clients in the VPN can indeed access each other normally.

NepPure commented 2 months ago

In my VPN networking mode, all subnet IPs can directly access each other. Do I not need STUN or TRUN and can I connect directly like in local mode?

jmattheis commented 2 months ago

Turn shouldn't be needed when the clients can see each other. Could you try using https://docs.docker.com/compose/compose-file/05-services/#network_mode network_mode: host for the screego service?

Could you try two desktop clients. The mobile device could be the problem.

jmattheis commented 2 months ago

Could you try out the newest version. I've made the logging more verbose by including the actual payload. In there you should see the *ice message. They should include the ips from the subnet. for me it looks like this. See e.g. 192.168.178.2 which is the ip of one of my clients.

2024-08-17T18:28:11+02:00 DBG WebSocket Receive event=*ws.HostICE id=cr0cv5b5ddu74p86r080 ip=::1 payload={"sid":"cr0cv6r5ddu74p86r08g","value":{"candidate":"candidate:4029029871 1 udp 2113937151 62261ca4-fc84-4d02-bbb4-1a6df848b9b3.local 33488 typ host generation 0 ufrag iWMe network-cost 999","sdpMLineIndex":0,"sdpMid":"0","usernameFragment":"iWMe"}}
2024-08-17T18:28:11+02:00 DBG WebSocket Send event=hostice id=cr0cv235ddu74p86r07g ip=::1 payload={"sid":"cr0cv6r5ddu74p86r08g","value":{"candidate":"candidate:4029029871 1 udp 2113937151 62261ca4-fc84-4d02-bbb4-1a6df848b9b3.local 33488 typ host generation 0 ufrag iWMe network-cost 999","sdpMLineIndex":0,"sdpMid":"0","usernameFragment":"iWMe"}}
2024-08-17T18:28:11+02:00 DBG WebSocket Receive event=*ws.HostICE id=cr0cv5b5ddu74p86r080 ip=::1 payload={"sid":"cr0cv6r5ddu74p86r08g","value":{"candidate":"candidate:485722745 1 udp 1677729535 192.168.178.2 33488 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag iWMe network-cost 999","sdpMLineIndex":0,"sdpMid":"0","usernameFragment":"iWMe"}}
2024-08-17T18:28:11+02:00 DBG WebSocket Send event=hostice id=cr0cv235ddu74p86r07g ip=::1 payload={"sid":"cr0cv6r5ddu74p86r08g","value":{"candidate":"candidate:485722745 1 udp 1677729535 192.168.178.2 33488 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag iWMe network-cost 999","sdpMLineIndex":0,"sdpMid":"0","usernameFragment":"iWMe"}}
NepPure commented 2 months ago

screego-20240818100556.log

There are new logs after the update, and the problem is the same.

services:
    screego:
        container_name: ${CONTAINER_NAME}
        deploy:
            resources:
                limits:
                    cpus: ${CPUS}
                    memory: ${MEMORY_LIMIT}
        environment:
            SCREEGO_EXTERNAL_IP: ${SCREEGO_EXTERNAL_IP}
            SCREEGO_TURN_PORT_RANGE: 50000:50200
            SCREEGO_AUTH_MODE: none
            SCREEGO_LOG_LEVEL: debug
            SCREEGO_USERS_FILE: data/user.txt
            SCREEGO_SECRET: nep
            SCREEGO_TRUST_PROXY_HEADERS: true
            SCREEGO_CORS_ALLOWED_ORIGINS: https://screego.neppure.vip/
        image: ghcr.io/screego/server:1.10.5
        network_mode: host
        labels:
            createdBy: Apps
        # networks:
        #     - 1panel-network
        volumes:
            - ./data:/data
        ports:
            - ${HOST_IP}:${PANEL_APP_PORT_HTTP}:5050
            - ${HOST_IP}:${PANEL_APP_PORT_TURN}:3478
            - ${HOST_IP}:${SCREEGO_TURN_PORT_RANGE}:50000-50200/udp
        restart: always
# networks:
#    1panel-network:
#         external: true
jmattheis commented 2 months ago

Have you tried using two desktop browsers clients for the sharing and receiving on different devices

NepPure commented 2 months ago

Have you tried using two desktop browsers clients for the sharing and receiving on different devices

It works with two PCs! But it's strange, I can use it with my phone in a pure LAN, but not with VPN.