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

Move URI type from pion/ice to pion/stun #134

Merged
merged 3 commits into from
May 10, 2023
Merged

Move URI type from pion/ice to pion/stun #134

merged 3 commits into from
May 10, 2023

Conversation

stv0g
Copy link
Member

@stv0g stv0g commented Jan 22, 2023

This PR moves the URL type from the pion/ice module to pion/stun and renames it to URI.
Hence this module gains full support for RFC7064 and RFC7065 (see #65).

The PR also adds a new function stun.DialURI(u *stun.URI, cfg *stun.DialConfig) which create the underlying connection for the client for you based on the URI Scheme and transport protocol. Hence it can also use the dtls and tls modules to establish an encrypted connection.

Currently, the connection establishment is done by hand in various places:

  • ICE relay candidate gathering
  • STUN example commands
  • TURN example commands

This is also related to #35 (comment)

Furthermore, we now fully support passing a custom transport.Net for testing which was previously not supported for TLS / DTLS connections.

@stv0g stv0g requested a review from Sean-Der January 22, 2023 11:11
@codecov
Copy link

codecov bot commented Jan 22, 2023

Codecov Report

Patch coverage: 70.11% and project coverage change: -39.95 ⚠️

Comparison is base (23bfc11) 98.16% compared to head (73f2585) 58.21%.

❗ Current head 73f2585 differs from pull request most recent head 8c40294. Consider uploading reports for the commit 8c40294 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #134       +/-   ##
===========================================
- Coverage   98.16%   58.21%   -39.95%     
===========================================
  Files          19       18        -1     
  Lines        1577     1716      +139     
===========================================
- Hits         1548      999      -549     
- Misses         23      684      +661     
- Partials        6       33       +27     
Flag Coverage Δ
go ?
wasm 58.21% <70.11%> (-3.36%) ⬇️

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

Impacted Files Coverage Δ
client.go 0.00% <0.00%> (-100.00%) ⬇️
helpers.go 97.72% <ø> (-2.28%) ⬇️
uri.go 96.94% <96.82%> (-3.06%) ⬇️

... and 16 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stv0g
Copy link
Member Author

stv0g commented May 5, 2023

This change currently breaks the API of the module. As we are still with v0, I dont think this is a huge deal. The breaking changes are also really minor..

Copy link
Member

@edaniels edaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass done. Basically LGTM except for some potential style changes!

client.go Show resolved Hide resolved
client.go Show resolved Hide resolved
client.go Show resolved Hide resolved
client.go Show resolved Hide resolved
client.go Show resolved Hide resolved
uri.go Outdated Show resolved Hide resolved
stv0g added 3 commits May 5, 2023 18:28
This makes it easier for users of pion/stun or pion/turn
packages to handle URLs. Next step, would be to remove
the URL type from pion/ice
Depending on the schema and transport, this function
establishes also encrypted connections via TLS/DTLS.
Until now, TLS and DTLS backed STUN clients
did not use a custom transport.Net.
Copy link
Member

@edaniels edaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stv0g stv0g merged commit e25856d into pion:master May 10, 2023
14 of 15 checks passed
@stv0g stv0g deleted the url branch May 10, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants