Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support stand alone STUN server mode #380

Closed
wants to merge 0 commits into from
Closed

Conversation

boks1971
Copy link
Contributor

@boks1971 boks1971 commented Apr 4, 2024

Description

Running in stand alone STUN server does not start
due to packet conn config requiring relay address config during validation.

To enable that mode, bypass validation if relay address config in packet conn config is nil.

Note that it is still validated in ListenerConfig.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 66.72%. Comparing base (40c468b) to head (bf5dd40).
Report is 1 commits behind head on master.

❗ Current head bf5dd40 differs from pull request most recent head 57c4727. Consider uploading reports for the commit 57c4727 to get more accurate results

Files Patch % Lines
server_config.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #380       +/-   ##
===========================================
+ Coverage   27.04%   66.72%   +39.68%     
===========================================
  Files          43       43               
  Lines        2888     2891        +3     
===========================================
+ Hits          781     1929     +1148     
+ Misses       2062      796     -1266     
- Partials       45      166      +121     
Flag Coverage Δ
go 66.72% <57.14%> (?)
wasm 27.01% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@boks1971
Copy link
Contributor Author

boks1971 commented Apr 4, 2024

@Sean-Der Not sure what is causing the test failures. I am unable to run tests locally also. Locally it fails on listening on 127.0.0.133

Running locally, I get the following failures

    server_test.go:311: 
        	Error Trace:	/Users/raja/ws/lk/turn/server_test.go:311
        	Error:      	Received unexpected error:
        	            	listen udp4 127.0.0.133:54321: bind: can't assign requested address
        	Test:       	TestServer/Filter_on_client_address_and_peer_IP
    server_test.go:322: 
        	Error Trace:	/Users/raja/ws/lk/turn/server_test.go:322
        	Error:      	Received unexpected error:
        	            	turn: conn cannot not be nil
        	Test:       	TestServer/Filter_on_client_address_and_peer_IP

And this panic

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10503afd8]

goroutine 100 [running]:
testing.tRunner.func1.2({0x1050dc9a0, 0x10527e3d0})
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1631 +0x1c4
testing.tRunner.func1()
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1634 +0x33c
panic({0x1050dc9a0?, 0x10527e3d0?})
	/opt/homebrew/opt/go/libexec/src/runtime/panic.go:770 +0x124
github.com/pion/turn/v3.(*Client).Listen(0x10511e628?)
	/Users/raja/ws/lk/turn/client.go:168 +0x18
github.com/pion/turn/v3.TestServer.func5(0x14000132000)
	/Users/raja/ws/lk/turn/server_test.go:323 +0xc00
testing.tRunner(0x14000132000, 0x1400000e090)
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1689 +0xec
created by testing.(*T).Run in goroutine 66
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1742 +0x318

And these failures happen before my changes too.

CI is failing at a different spot.

Can you please have a look when you get a chance and advise?

@Sean-Der
Copy link
Member

Sean-Der commented Apr 4, 2024

Will do @boks1971 ! Will figure out CI and merge today

@Sean-Der Sean-Der force-pushed the raja_standalone_stun branch 7 times, most recently from bf5dd40 to 57c4727 Compare April 4, 2024 15:35
@Sean-Der Sean-Der closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants