Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

render streaming not working in different network

Discussion in 'Unity Render Streaming' started by AceJiang, Apr 22, 2023.

  1. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    14
    enable https,render streaming works properly in the same network,but not working in different network.
    I think my trun server is ok,but https client unable to receive any bytes.
    chrome://webrtc-internals:
    Code (CSharp):
    1. 2023/4/22 17:05:31    createDataChannel
    2. 2023/4/22 17:05:31    negotiationneeded
    3. 2023/4/22 17:05:31    setLocalDescription
    4. 2023/4/22 17:05:31    setLocalDescriptionOnSuccess (type: "offer", 2 sections)
    5. 2023/4/22 17:05:31    signalingstatechange
    6. 2023/4/22 17:05:31    icegatheringstatechange
    7. 2023/4/22 17:05:31    icecandidate(sdpMid: 0, sdpMLineIndex: 0, type: host)
    8. 2023/4/22 17:05:31    icecandidateerror
    9. 2023/4/22 17:05:31    icecandidate(sdpMid: 0, sdpMLineIndex: 0, type: srflx)
    10. 2023/4/22 17:05:31    icecandidateerror
    11. 2023/4/22 17:05:31    icecandidate(sdpMid: 0, sdpMLineIndex: 0, type: relay)
    12. 2023/4/22 17:05:32    icecandidate(sdpMid: 0, sdpMLineIndex: 0, type: relay)
    13. 2023/4/22 17:05:35    icecandidate(sdpMid: 0, sdpMLineIndex: 0, type: relay)
    14. 2023/4/22 17:05:35    icegatheringstatechange
    15. 2023/4/22 17:05:59    addIceCandidateFailed
    16. 2023/4/22 17:05:59    setRemoteDescription (type: "answer", 2 sections)
    17. 2023/4/22 17:05:59    iceconnectionstatechange
    18. 2023/4/22 17:05:59    setRemoteDescriptionOnSuccess
    19. 2023/4/22 17:05:59    signalingstatechange
    20. 2023/4/22 17:05:59    connectionstatechange
    21. 2023/4/22 17:05:59    setRemoteDescription (type: "offer", 4 sections)
    22. 2023/4/22 17:05:59    setRemoteDescriptionOnSuccess
    23. 2023/4/22 17:05:59    signalingstatechange
    24. 2023/4/22 17:05:59    transceiverAdded
    25. 2023/4/22 17:05:59    transceiverAdded
    26. 2023/4/22 17:05:59    setLocalDescription
    27. 2023/4/22 17:05:59    setLocalDescriptionOnSuccess (type: "answer", 4 sections)
    28. 2023/4/22 17:05:59    signalingstatechange
    29. 2023/4/22 17:05:59    transceiverModified
    30. 2023/4/22 17:05:59    transceiverModified
    31. 2023/4/22 17:05:59    addIceCandidate(sdpMid: 0, sdpMLineIndex: 0, type: host)sdpMid: 0, sdpMLineIndex: 0, candidate: candidate:2431464363 1 tcp 1518280447 192.168.1.110 51138 typ host tcptype passive generation 0 ufrag HkfH network-id 1 network-cost 10
    32. 2023/4/22 17:06:20    iceconnectionstatechange
    33. 2023/4/22 17:06:20    close
    34. 2023/4/22 17:06:20    connectionstatechange
    35. 2023/4/22 17:06:20    connectionstatechange
    36.         closed
    browser status:
    Code (CSharp):
    1. audio receiving stream stats
    2. Bitrate: 0.00 kbit/sec
    3. video receiving stream stats
    4. Decoder: undefined
    5. Resolution: undefinedxundefined
    6. Framerate: undefined
    7. Bitrate: 0.00 kbit/sec
     
  2. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    277
    Looking at the log, I think that addIceCandidate has only iceCandidate of type: host, which is the reason why I can not connect.
    What is passed as the config (RtcPeerConfiguration type) argument when creating an RTCPeerConnection instance? .
     
  3. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    14
    Thank you gtk2k.
    This is google chrome trickle ice gather candidates info,icecandidateerror is same with 701. I will find the cause of error code 701.
    Code (CSharp):
    1. Note: errors from onicecandidateerror above are not neccessarily fatal. For example an IPv6 DNS lookup may fail but relay candidates can still be gathered via IPv4.
    2. The server stun:relay.xxxxx.com:3478 returned an error with code=701:
    3. STUN host lookup received error.
    4. The server turn:relay.xxxxx.com:3478?transport=udp returned an error with code=701:
    5. TURN host lookup received error.
    6. The server turn:relay.xxxxx.com:3478?transport=udp returned an error with code=401:
    7. Unauthorized
    8. The server turn:relay.xxxxx.com:3478?transport=tcp returned an error with code=401:
    9. Unauthorized
    10. The server turn:relay.xxxxx.com:3478?transport=tcp returned an error with code=401:
    11. Unauthorized
    12. The server stun:relay.xxxxx.com:3478 returned an error with code=701:
    13. STUN binding request timed out.
     
  4. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    76
    The TURN server is returning Unauthorized so maybe your credential settings are wrong?
    Signaling is completed, but data transmission and reception are not possible because TURN does not accept to receive data.
     
  5. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    14
    Code (CSharp):
    1.  
    2. export function getRTCConfiguration() {
    3.   let config = {};
    4.   config.sdpSemantics = 'unified-plan';
    5.   config.iceServers = [
    6.     {
    7.       urls: [
    8.         'turn:relay.xxxxx.com:3478?transport=udp',
    9.         'turn:relay.xxxxx.com:3478?transport=tcp'
    10.       ],
    11.       username: 'demo',
    12.       credential: '123456'
    13.     },
    14.     {
    15.       urls: ['stun:relay.xxxxx.com:3478']
    16.     }
    17.   ];
    18.   return config;
    19. }
    20.  
    21. Trickle ICE============================================================
    22. Time    Type    Foundation    Protocol    Address    Port    Priority    URL (if present)    relayProtocol (if present)
    23. 0.004    host    2881217104    udp    e248ed0a-d927-4edc-91df-8515cc9304ee.local    51117    126 | 30 | 255    
    24. 0.013    srflx    3831070550    udp    119.130.27.88    51117    100 | 30 | 255    stun:relay.xxxxx.com:3478
    25. 0.078    relay    2155874119    udp    0.0.0.0    62559    2 | 32 | 255    turn:relay.xxxxx.com:3478?transport=udp    udp
    26. 1.447    relay    2116735955    udp    0.0.0.0    59200    1 | 31 | 255    turn:relay.xxxxx.com:3478?transport=tcp    tcp
    27. 2.779    Done
    28. 2.779    relay    2116735955    udp    0.0.0.0    61815    1 | 31 | 255    turn:relay.xxxxx.com:3478?transport=tcp    tcp
    29. Gather candidates
    30. Note: errors from onicecandidateerror above are not neccessarily fatal. For example an IPv6 DNS lookup may fail but relay candidates can still be gathered via IPv4.
    31. The server stun:relay.xxxxx.com:3478 returned an error with code=701:
    32. STUN host lookup received error.
    33. The server turn:relay.xxxxx.com:3478?transport=udp returned an error with code=701:
    34. TURN host lookup received error.
    35.  
    36.  
    37. turnserver.conf============================================
    38. relay-device=eth0
    39. listening-device=eth0
    40. listening-port=3478
    41. tls-listening-port=5349
    42. alt-listening-port=3479
    43. alt-tls-listening-port=5350
    44. listening-ip=172.26.28.234
    45. relay-ip=172.26.28.234
    46. external-ip=0.0.0.0
    47. relay-threads=50
    48. lt-cred-mech
    49. cert=/usr/local/etc/turn_server_cert.pem
    50. pkey=/usr/local/etc/turn_server_pkey.pem
    51. pidfile=/var/run/turnserver.pid
    52. min-port=49152
    53. max-port=65535
    54. realm=draw.xxxxx.com
    55. user=demo:123456
    56. cli-password=123456
    57.  
     
    Last edited: Apr 28, 2023
  6. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    14
    What Settings am I missing。signaling.js is not working。
     
  7. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    770
    Hi, first of all, to isolate the problem, I recommend to check the connection between two browsers with TURN, not using Unity. If the connection is succeeded, we can see that the reason of the issue is our package.
     
  8. AceJiang

    AceJiang

    Joined:
    Dec 14, 2019
    Posts:
    14
    Thank you,I try it.