-
Notifications
You must be signed in to change notification settings - Fork 153
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
Implement Active TCP-ICE #394
Conversation
7d62c0f
to
a6ff55d
Compare
Codecov ReportBase: 78.23% // Head: 77.13% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #394 +/- ##
==========================================
- Coverage 78.23% 77.13% -1.10%
==========================================
Files 36 36
Lines 4273 4348 +75
==========================================
+ Hits 3343 3354 +11
- Misses 723 779 +56
- Partials 207 215 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@dgunay were you able to make a successful connection? |
agent.go
Outdated
@@ -130,6 +131,10 @@ type Agent struct { | |||
insecureSkipVerify bool | |||
|
|||
proxyDialer proxy.Dialer | |||
|
|||
tcpConnections map[string]net.Conn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would store the tcpConnections
inside the Active TCP
candidate. Would love to avoid putting more state in the Agent
itself
Does Chrome expose the ports it dialed on?
a6ff55d
to
a565945
Compare
a565945
to
1604431
Compare
TCP connection is ready and some messages are sent over the connection. But after first messages a connection freezes.
May be connection works only in 1 direction yet? |
@Sean-Der please take a look on new implementation. |
I see that pair nomination is not performed. |
Finally first working version (that goes to connected state). |
holy shit! amazing work @ashellunts this is so exciting :) I should have some time later today. sorry about the delay. This is really great. Will make clients better, and really excited to see coverage for servers improve. |
79392b9
to
bc02898
Compare
Thanks. 2 days debugging finally worked out :D |
For now it works only if you have only 1 network interface 😭 |
agent_config.go
Outdated
@@ -50,7 +50,8 @@ func defaultCandidateTypes() []CandidateType { | |||
// AgentConfig collects the arguments to ice.Agent construction into | |||
// a single structure, for future-proofness of the interface | |||
type AgentConfig struct { | |||
Urls []*URL | |||
activeTCP bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DisableActiveTCP
By default we should enable Active TCP
@ashellunts This looks really good! If you can fix the linter and test failures I think we can merge this really soon :) |
a.log.Infof("Ignoring remote candidate with tcpType active: %s", c) | ||
return nil | ||
} | ||
// if c.TCPType() == TCPTypeActive { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be deleted?
e2c4f68
to
8e558f8
Compare
@Sean-Der addressed some comments and linter errors. There are still a few concurrency bugs it looks like. |
@dgunay Thank you so much for continuing the work! |
EDIT: nevermind, I've clearly forgotten how this PR works, it already initiates TCP connections - I'll keep digging |
Best I can tell for now is that none of the candidates are being nominated. |
6df0a1f
to
eb3aaee
Compare
6a4f362
to
278b539
Compare
278b539
to
7da92da
Compare
I am excited to see that you picked up the PR @ashellunts Let me know if I can support with testing, reviewing or something else :) |
Thanks. I will appreciate if you can read PR changes and maybe notice something completely wrong. Sometime ago I had the test passing. Now it doesn't work. And I am debugging to understand what is going on. |
I will dig into the RFC a bit more into detail later. Something which confused me a bit: Does an agent always pick the active or the passive role? I thought it would make more sense to active & passive candidates gathered by the same agent. |
Not sure. But for me it looks logical to have either passive agent or active one. |
1542ccb
to
1190af5
Compare
1190af5
to
887ae3a
Compare
I've had a look at RFC6544, which is mainly concerned about active/passive/so TCP candidates for ICE. Not about active/passive agents. We might want to think about maybe adding
The reason why I am proposing this change is, that in my application I have might have situations in which each side of the P2P connection is/is-not dialable from the outside. So determine the role is not feasible beforehand and would require a complex role-conflict resolution (just like for Lite ICE agents). Hence, I think its easier to generate all types of TCP candidates in the first place. And allow the user to limit those by the settings which I mentioned above. |
887ae3a
to
ed64aab
Compare
Thank you for the feedback. Sounds good. |
Created another PR instead of this one: #565 |
No description provided.