Skip to content

Connection using relay fails after successful connection #146

@jopicornell

Description

@jopicornell

Your environment.

  • Version: turn v2.0.3 / stun v0.3.5
  • Browser: Chromium Version 83.0.4103.116
  • Other Information:
    Our logs show this on the browser:
signalStateChange:  have-remote-offer
instrument.js:110 signalStateChange:  stable
instrument.js:110 connectionStateChange:  connecting
instrument.js:110 connectionStateChange:  connected
instrument.js:110 connectionStateChange:  failed
instrument.js:110 negotiationNeeded 
--- Reconnecting ---
instrument.js:110 signalStateChange:  have-remote-offer
instrument.js:110 signalStateChange:  stable
instrument.js:110 connectionStateChange:  connecting
instrument.js:110 connectionStateChange:  connected

I log every message I receive. What seems to happen from the server is that when a refresh message, there's some kind of error allocating. This is what the server is logging on a TCP connection:

DEBU[0981] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): ChannelBind success response l=24 attrs=1 id=TFZoV3NHRkJIcXpU 
DEBU[0981] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): CreatePermission request l=96 attrs=5 id=TFZoV3NHRkJIcXpU 
DEBU[0981] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): ChannelBind success response l=24 attrs=1 id=dFFGdElHOUJLOW92 
DEBU[0981] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): CreatePermission request l=96 attrs=5 id=dFFGdElHOUJLOW92 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): Refresh success response l=32 attrs=2 id=WVduUXdVcXhtSVd4 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): Refresh request l=92 attrs=5 id=WVduUXdVcXhtSVd4 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): Refresh success response l=32 attrs=2 id=V0p0c2xBV0RDbEt1 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): Refresh request l=92 attrs=5 id=V0p0c2xBV0RDbEt1 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate error response l=56 attrs=3 id=TGYvMFZ5aFpsdDFN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate request l=8 attrs=1 id=TGYvMFZ5aFpsdDFN 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate success response l=56 attrs=4 id=bitUS044dk83cmxP 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate request l=92 attrs=5 id=bitUS044dk83cmxP 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate error response l=56 attrs=3 id=Wmw3SUFGdXRnbk8r 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate request l=8 attrs=1 id=Wmw3SUFGdXRnbk8r 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate success response l=56 attrs=4 id=OWM0dnRJVzFxenEx 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate request l=92 attrs=5 id=OWM0dnRJVzFxenEx 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=112 attrs=2 id=RHZxS2l5cjZ3TXVL 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=116 attrs=2 id=WVZ0NXZkY21Vemhm 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Data indication l=116 attrs=2 id=Ad91szQt5kuQgWF1 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=80 attrs=2 id=c2lRcEJlL1prRDVH 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=80 attrs=2 id=pEaoNTgebydwgljZ 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=112 attrs=2 id=VVZUQUlmWENzVm9X 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=112 attrs=2 id=vEoPdBlJqaDuErDM 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=116 attrs=2 id=Y0JlZnlDVHp5c1ZX 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Data indication l=116 attrs=2 id=IUhIvSplvCpwzsz6 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=80 attrs=2 id=ZUp1cTBMWlBwdDA1 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=80 attrs=2 id=MDoKjmrv9V4YRkhQ 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=80 attrs=2 id=bXY3SGd5dElaNFlL 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Data indication l=80 attrs=2 id=QVPp6Y1when1gXNqGTAE 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=RFZiaVg5OE5UVDU2 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind request l=104 attrs=6 id=RFZiaVg5OE5UVDU2 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=172 attrs=2 id=dWRxQnByditBSkxy 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=172 attrs=2 id=S5d5IZOE1QOM2fdI 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=SkpZb3VkUGR6enpl 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=636 attrs=2 id=eXEzNGtrb2ZzQkhz 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0990] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0990] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0990] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0990] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0991] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0991] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0991] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0991] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0993] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0993] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0993] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0993] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0997] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0997] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0997] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[1005] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[1005] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[1005] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[1005] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[1013] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[1013] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[1013] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[1013] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 

This is a log when UDP connection fails:

DEBU[0051] Inbound STUN(id=uVlsoYNtlIzL) from 185.227.212.57:51652: Binding request l=0 attrs=0 id=dVZsc29ZTnRsSXpM+ 
DEBU[0051] Outbound STUN (id=uVlsoYNtlIzL) from 185.227.212.57:51652: Binding success response l=20 attrs=2 id=dVZsc29ZTnRsSXpM+ 
DEBU[0051] Inbound STUN(id=FEw8d00PB3Ym) from 185.227.212.57:51652: Allocate request l=8 attrs=1 id=RkV3OGQwMFBCM1lt+ 
DEBU[0051] Outbound STUN (id=FEw8d00PB3Ym) from 185.227.212.57:51652: Allocate error response l=56 attrs=3 id=RkV3OGQwMFBCM1lt+ 
DEBU[0051] Inbound STUN(id=oeVFnXfekCrD) from 185.227.212.57:51652: Allocate request l=92 attrs=5 id=b2VWRm5YZmVrQ3JE+ 
DEBU[0051] Outbound STUN (id=oeVFnXfekCrD) from 185.227.212.57:51652: Allocate success response l=56 attrs=4 id=b2VWRm5YZmVrQ3JE+ 
DEBU[0051] Inbound STUN(id=EcjQgYhRDzJl) from 185.227.212.57:47649: Binding request l=0 attrs=0 id=RWNqUWdZaFJEekps+ 
DEBU[0051] Outbound STUN (id=EcjQgYhRDzJl) from 185.227.212.57:47649: Binding success response l=20 attrs=2 id=RWNqUWdZaFJEekps+ 
DEBU[0051] Inbound STUN(id=F04yH+qh6jG8) from 185.227.212.57:47649: Allocate request l=8 attrs=1 id=RjA0eUgrcWg2akc4+ 
DEBU[0051] Outbound STUN (id=F04yH+qh6jG8) from 185.227.212.57:47649: Allocate error response l=56 attrs=3 id=RjA0eUgrcWg2akc4+ 
DEBU[0051] Inbound STUN(id=XgS2Y51kO3n+) from 185.227.212.57:47649: Allocate request l=92 attrs=5 id=WGdTMlk1MWtPM24r+ 
DEBU[0051] Outbound STUN (id=XgS2Y51kO3n+) from 185.227.212.57:47649: Allocate success response l=56 attrs=4 id=WGdTMlk1MWtPM24r+ 
DEBU[0051] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0051] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0051] Inbound STUN(id=IPgYTone+b23) from 185.227.212.57:47649: Send indication l=112 attrs=2 id=SVBnWVRvbmUrYjIz+ 
DEBU[0051] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0051] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0051] Inbound STUN(id=ys97jfnaU+hf) from 185.227.212.57:51652: Send indication l=116 attrs=2 id=eXM5N2pmbmFVK2hm+ 
DEBU[0051] Outbound STUN (id=b�_M�6�h�) from 185.227.212.57:47649: Data indication l=116 attrs=2 id=YuJfD00Pkjb3aByb+ 
DEBU[0051] Inbound STUN(id=3tcTxRZqbjAW) from 185.227.212.57:47649: Send indication l=80 attrs=2 id=M3RjVHhSWnFiakFX+ 
DEBU[0051] Outbound STUN (id=���|���V}��) from 185.227.212.57:51652: Data indication l=80 attrs=2 id=t/aHfLOQ9FZ9vxGY+ 
DEBU[0051] Inbound STUN(id=zmhbdu1fcGJo) from 185.227.212.57:47649: Send indication l=112 attrs=2 id=em1oYmR1MWZjR0pv+ 
DEBU[0051] Outbound STUN (id=�+KcM�4�5D�) from 185.227.212.57:51652: Data indication l=112 attrs=2 id=jStLY02ZNI01RKQF+ 
DEBU[0051] Inbound STUN(id=v/V9D2Qoyk/I) from 185.227.212.57:51652: Send indication l=80 attrs=2 id=di9WOUQyUW95ay9J+ 
DEBU[0051] Outbound STUN (id=�ðMDv���!) from 185.227.212.57:47649: Data indication l=80 attrs=2 id=q8OwBU1Edo7N1xch+ 
DEBU[0051] Inbound STUN(id=WxJC9dUZLg5V) from 185.227.212.57:47649: ChannelBind request l=104 attrs=6 id=V3hKQzlkVVpMZzVW+ 
DEBU[0051] Outbound STUN (id=WxJC9dUZLg5V) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=V3hKQzlkVVpMZzVW+ 
DEBU[0051] Inbound STUN(id=EwWwMJDXi6yi) from 185.227.212.57:47649: Send indication l=172 attrs=2 id=RXdXd01KRFhpNnlp+ 
DEBU[0051] Outbound STUN (id=�+l�����4�yR) from 185.227.212.57:51652: Data indication l=172 attrs=2 id=5ytsh5nz/dI07XlS+ 
DEBU[0051] Inbound STUN(id=rMpdM29F0KSJ) from 185.227.212.57:51652: Send indication l=116 attrs=2 id=ck1wZE0yOUYwS1NK+ 
DEBU[0051] Outbound STUN (id=�`���l>��3) from 185.227.212.57:51652: Data indication l=80 attrs=2 id=GNhgf/71HGw+0sMz+ 
DEBU[0051] Inbound STUN(id=J/A22OfBKP6T) from 185.227.212.57:51652: ChannelBind request l=104 attrs=6 id=Si9BMjJPZkJLUDZU+ 
DEBU[0051] Outbound STUN (id=J/A22OfBKP6T) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=Si9BMjJPZkJLUDZU+ 
DEBU[0051] Inbound STUN(id=3x+lY40MEH6l) from 185.227.212.57:51652: Send indication l=636 attrs=2 id=M3grbFk0ME1FSDZs+ 
DEBU[0052] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0052] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0052] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0052] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0053] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0053] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0053] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0053] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0055] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0055] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0055] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0055] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0059] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0059] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0059] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0059] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 

Additionally, I've done these other things to discard something with my connection or other unrelated issues:

  • I tested with iceTransportPolicy: 'all' and it works perfectly well
  • I tested on the same local network
  • I tested on different networks (All, the server and the two peers)
  • I tested deploying it to a GCE instance
  • The code is barely the simple example in Github, only adding TCP listeners
  • I tried another free turn (http://numb.viagenie.ca/) with iceTransportPolicy: 'relay' and it works perfectly well.

What did you do?

Simply grab the example, and run it:

	udpListener, err := net.ListenPacket("udp4", fmt.Sprintf("0.0.0.0:%d", 3478))
	if err != nil {
		log.Panicf("Failed to create TURN server listener: %s", err)
	}
	tcpListener, err := net.Listen("tcp4", fmt.Sprintf("0.0.0.0:%d", 3478))
	if err != nil {
		log.Panicf("Failed to create TURN server listener: %s", err)
	}
	s, err := turn.NewServer(turn.ServerConfig{
		Realm: "kydemy",
		// Set AuthHandler callback
		// This is called everytime a user tries to authenticate with the TURN server
		// Return the key for that user, or false when no user is found
		AuthHandler: func(username string, realm string, srcAddr net.Addr) ([]byte, bool) {
			return turn.GenerateAuthKey("test", "test", "test"), true
		},
		 PacketConnConfigs: []turn.PacketConnConfig{
			{
				PacketConn: &models.UdpPacketConn{PacketConn: udpListener},
				RelayAddressGenerator: &turn.RelayAddressGeneratorStatic{
					RelayAddress: net.ParseIP(TurnConfiguration.PublicIP),
					Address:      "0.0.0.0",
				},
			},
		},
		ListenerConfigs: []turn.ListenerConfig{
			{
				Listener: &models.TcpListener{Listener: tcpListener},
				RelayAddressGenerator: &turn.RelayAddressGeneratorStatic{
					RelayAddress: net.ParseIP(TurnConfiguration.PublicIP),
					Address:      "0.0.0.0",
				},
			},
		},
	})

Then you do a webRTC connection using this RTCPeerConfiguration:

const peerConnection = new RTCPeerConnection({ 
    IceServers: [{
          urls: 'turn:myturn.test:3478?transport=udp',
          username: 'kydemy',
          credential: 'kydemy'
    }],
    iceTransportPolicy: 'relay' 
})

What did you expect?

The connection to be stable using a relay transport policy.

What happened?

The connection keeps failing consistently, every 20/40 seconds. pion/turn doesn't log any error, but in the debug logs for each connection, it shows some allocating errors. The browser only shows the "failed" state, giving no extra information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions