-
-
Notifications
You must be signed in to change notification settings - Fork 236
Description
Thank you for the author's open source work, but I encounter authentication failure when using a coturn/turnserver. This is because the project does not have the REFRESH, CREATE_PERMASS, CHANNEL_BIND functions. Can the author add these functions to solve the problem of public network relay communication? For example, implementing the business logic corresponding to the following structure, currently only the first two items are available:
typedef enum StunMethod {
STUN_METHOD_BINDING = 0x0001,
STUN_METHOD_ALLOCATE = 0x003,
STUN_METHOD_REFRESH = 0x004,
STUN_METHOD_SEND = 0x006,
STUN_METHOD_DATA = 0x007,
STUN_METHOD_CREATE_PERMISSION = 0x008,
STUN_METHOD_CHANNEL_BIND = 0x009
} StunMethod;
Capture of authentication process for libpeer failure:
No. Time Source Destination Protocol Length Info
682 19.865785430 192.168.1.26 192.168.1.9 STUN 86 Allocate Request UDP user: username1
683 19.866623204 192.168.1.9 192.168.1.26 STUN 154 Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: mycompany.org
712 19.880397719 192.168.1.26 192.168.1.9 STUN 158 Allocate Request UDP user: username1 with nonce realm: mycompany.org
713 19.881491661 192.168.1.9 192.168.1.26 STUN 158 Allocate Success Response XOR-RELAYED-ADDRESS: 192.168.1.9:60251 XOR-MAPPED-ADDRESS: 192.168.1.26:50559 lifetime: 600
746 20.114071112 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
764 20.378211257 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
768 20.685002291 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
771 20.891055297 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
775 21.024432790 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
778 21.299710601 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
781 21.510277826 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
784 21.811806863 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
788 21.991828125 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
792 22.171647736 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
797 22.425441918 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
801 22.636085171 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
804 22.937860551 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
808 23.061777919 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
811 23.347533016 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
814 23.552039068 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
817 23.762327047 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
822 23.969447614 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
826 24.268821705 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
829 24.474334492 192.168.1.26 192.168.1.9 STUN 134 Binding Request user: SXHA:rBOC
The normal authentication process for JS code:
No. Time Source Destination Protocol Length Info
318 13.554590437 192.168.1.7 192.168.1.9 STUN 62 Binding Request
319 13.554591411 192.168.1.7 192.168.1.9 STUN 62 Binding Request
320 13.554591608 192.168.1.7 192.168.1.9 STUN 62 Binding Request
321 13.555217416 192.168.1.9 192.168.1.7 STUN 130 Binding Success Response XOR-MAPPED-ADDRESS: 192.168.1.7:37767 MAPPED-ADDRESS: 192.168.1.7:37767 RESPONSE-ORIGIN: 192.168.1.9:3478
322 13.555316340 192.168.1.9 192.168.1.7 STUN 130 Binding Success Response XOR-MAPPED-ADDRESS: 192.168.1.7:37456 MAPPED-ADDRESS: 192.168.1.7:37456 RESPONSE-ORIGIN: 192.168.1.9:3478
323 13.555381260 192.168.1.9 192.168.1.7 STUN 130 Binding Success Response XOR-MAPPED-ADDRESS: 192.168.1.7:41876 MAPPED-ADDRESS: 192.168.1.7:41876 RESPONSE-ORIGIN: 192.168.1.9:3478
324 13.602831848 192.168.1.7 192.168.1.9 STUN 70 Allocate Request UDP
325 13.602832273 192.168.1.7 192.168.1.9 STUN 70 Allocate Request UDP
326 13.602832422 192.168.1.7 192.168.1.9 STUN 70 Allocate Request UDP
327 13.603344471 192.168.1.9 192.168.1.7 STUN 154 Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: mycompany.org
328 13.603392489 192.168.1.9 192.168.1.7 STUN 154 Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: mycompany.org
329 13.603483469 192.168.1.9 192.168.1.7 STUN 154 Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: mycompany.org
331 13.613967454 192.168.1.7 192.168.1.9 STUN 150 Allocate Request UDP user: username1 realm: mycompany.org with nonce
332 13.613968009 192.168.1.7 192.168.1.9 STUN 150 Allocate Request UDP user: username1 realm: mycompany.org with nonce
333 13.613968147 192.168.1.7 192.168.1.9 STUN 150 Allocate Request UDP user: username1 realm: mycompany.org with nonce
334 13.614985191 192.168.1.9 192.168.1.7 STUN 150 Allocate Success Response XOR-RELAYED-ADDRESS: 192.168.1.9:57190 XOR-MAPPED-ADDRESS: 192.168.1.7:37456 lifetime: 600
335 13.615067227 192.168.1.9 192.168.1.7 STUN 150 Allocate Success Response XOR-RELAYED-ADDRESS: 192.168.1.9:63689 XOR-MAPPED-ADDRESS: 192.168.1.7:41876 lifetime: 600
336 13.615146225 192.168.1.9 192.168.1.7 STUN 150 Allocate Success Response XOR-RELAYED-ADDRESS: 192.168.1.9:51324 XOR-MAPPED-ADDRESS: 192.168.1.7:37767 lifetime: 600
353 14.200118501 192.168.1.7 192.168.1.9 STUN 150 Refresh Request lifetime: 0 user: username1 realm: mycompany.org with nonce
354 14.200118889 192.168.1.7 192.168.1.9 STUN 150 Refresh Request lifetime: 0 user: username1 realm: mycompany.org with nonce
355 14.200118979 192.168.1.7 192.168.1.9 STUN 154 CreatePermission Request XOR-PEER-ADDRESS: 192.168.1.9:49987 user: username1 realm: mycompany.org with nonce
356 14.200119082 192.168.1.7 192.168.1.9 STUN 178 Send Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
357 14.200560963 192.168.1.9 192.168.1.7 STUN 126 Refresh Success Response lifetime: 0
358 14.200593435 192.168.1.9 192.168.1.7 STUN 126 Refresh Success Response lifetime: 0
359 14.200612387 192.168.1.9 192.168.1.7 STUN 118 CreatePermission Success Response
360 14.201808650 192.168.1.9 192.168.1.7 STUN 174 Data Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
361 14.206158127 192.168.1.7 192.168.1.9 ICMP 154 Destination unreachable (Port unreachable)
362 14.206158267 192.168.1.7 192.168.1.9 ICMP 154 Destination unreachable (Port unreachable)
363 14.236886851 192.168.1.9 192.168.1.7 STUN 206 Data Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
364 14.248333876 192.168.1.7 192.168.1.9 STUN 142 Send Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
365 14.249361434 192.168.1.9 192.168.1.7 STUN 266 Data Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
366 14.258925191 192.168.1.7 192.168.1.9 STUN 162 Channel-Bind Request ChannelNumber=0x4000 XOR-PEER-ADDRESS: 192.168.1.9:49987 user: username1 realm: mycompany.org with nonce
367 14.258925378 192.168.1.7 192.168.1.9 STUN 722 Send Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
368 14.258925400 192.168.1.7 192.168.1.9 STUN 178 Send Indication XOR-PEER-ADDRESS: 192.168.1.9:49987
369 14.259127124 192.168.1.9 192.168.1.7 STUN 118 Channel-Bind Success Response
370 14.260290416 192.168.1.9 192.168.1.7 STUN 594 ChannelData TURN Message
371 14.260327831 192.168.1.9 192.168.1.7 STUN 110 ChannelData TURN Message