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

add tcp/udp proxy feature #234

Closed
wants to merge 106 commits into from
Closed

add tcp/udp proxy feature #234

wants to merge 106 commits into from

Conversation

jxd134
Copy link
Contributor

@jxd134 jxd134 commented Sep 3, 2021

Add tcp/udp proxy feature
Show it for everyone to comment or correct.

@benja-wu benja-wu added the enhancement New feature or request label Sep 3, 2021
@benja-wu benja-wu added this to In progress in Easegress Project via automation Sep 3, 2021
Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 234 Deploy Test Success

@benja-wu benja-wu added this to the v1.4.0 milestone Sep 3, 2021
@benja-wu benja-wu linked an issue Sep 3, 2021 that may be closed by this pull request
@zhao-kun zhao-kun changed the title add tpc proxy feature add TCP proxy feature Sep 3, 2021
Copy link
Contributor Author

@jxd134 jxd134 left a comment

Choose a reason for hiding this comment

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

I tend to add new function in interface.

pkg/object/tcpserver/tcpserver.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2021

Codecov Report

Merging #234 (97b8f1a) into main (554efe7) will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #234      +/-   ##
==========================================
+ Coverage   80.43%   80.57%   +0.13%     
==========================================
  Files          70       70              
  Lines        8093     8171      +78     
==========================================
+ Hits         6510     6584      +74     
- Misses       1223     1230       +7     
+ Partials      360      357       -3     
Impacted Files Coverage Δ
pkg/filter/mock/mock.go 90.42% <0.00%> (-4.66%) ⬇️
pkg/filter/proxy/pool.go 80.00% <0.00%> (-2.66%) ⬇️
pkg/object/mqttproxy/client.go 77.16% <0.00%> (-1.44%) ⬇️
pkg/object/mqttproxy/broker.go 75.05% <0.00%> (+0.05%) ⬆️
pkg/object/meshcontroller/spec/spec.go 87.20% <0.00%> (+0.07%) ⬆️
pkg/util/urlclusteranalyzer/urlclusteranalyzer.go 96.10% <0.00%> (+0.38%) ⬆️
pkg/util/jmxtool/agent_controller.go 66.66% <0.00%> (+1.96%) ⬆️
pkg/object/mqttproxy/storage.go 86.30% <0.00%> (+4.10%) ⬆️
pkg/object/pipeline/mock.go 86.95% <0.00%> (+5.94%) ⬆️
pkg/filter/proxy/request.go 95.31% <0.00%> (+9.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 758c860...97b8f1a. Read the comment docs.

@haoel
Copy link
Contributor

haoel commented Sep 3, 2021

@jxd134 There are some warnings in your code which reported by glint, could you please help to fix them?

@jxd134
Copy link
Contributor Author

jxd134 commented Sep 3, 2021

@haoel I will fix it in future commit.

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 234 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 234 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 234 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 234 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test FAILED]megaease/easegress Pull Request 234 Deploy Test failed

Easegress Project automation moved this from In progress to Review in progress Sep 9, 2021
Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test FAILED]megaease/easegress Pull Request 234 Deploy Test failed

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test FAILED]megaease/easegress Pull Request 234 Deploy Test failed

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

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

[TASK:easegress-pr-test FAILED]megaease/easegress Pull Request 234 Deploy Test failed

pkg/object/udpproxy/session.go Outdated Show resolved Hide resolved
@jxd134
Copy link
Contributor Author

jxd134 commented Jan 7, 2022

I am now confused.
The pr put the socket read/write operations in two goroutines. When I actively close the socket, the read/write operation will report an exception. The key is that the thrown exception is difficult to distinguish whether it is caused by closing the socket or caused by a network exception.
The general practice is to set a timeout for socket read/write, and when a timeout exception is thrown, determine whether the connection is closed at this time. But which goroutine will close the socket after that, I don’t have a good idea now.

@samutamm
Copy link
Contributor

samutamm commented Jan 7, 2022

I am now confused. The pr put the socket read/write operations in two goroutines. When I actively close the socket, the read/write operation will report an exception. The key is that the thrown exception is difficult to distinguish whether it is caused by closing the socket or caused by a network exception. The general practice is to set a timeout for socket read/write, and when a timeout exception is thrown, determine whether the connection is closed at this time. But which goroutine will close the socket after that, I don’t have a good idea now.

Are you experiencing some specific reproducible error or is this more like a general question about the design? For directional channels the sender should close the channel but here the connections are bidirectional, right?

@jxd134
Copy link
Contributor Author

jxd134 commented Jan 7, 2022

I am now confused. The pr put the socket read/write operations in two goroutines. When I actively close the socket, the read/write operation will report an exception. The key is that the thrown exception is difficult to distinguish whether it is caused by closing the socket or caused by a network exception. The general practice is to set a timeout for socket read/write, and when a timeout exception is thrown, determine whether the connection is closed at this time. But which goroutine will close the socket after that, I don’t have a good idea now.

Are you experiencing some specific reproducible error or is this more like a general question about the design? For directional channels the sender should close the channel but here the connections are bidirectional, right?

yes, that's it

@jxd134
Copy link
Contributor Author

jxd134 commented Apr 27, 2022

There is no time to solve it in the short term, so I can only choose to give up.
sorry

@jxd134 jxd134 closed this Apr 27, 2022
Easegress Project automation moved this from Review in progress to Done Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

[feature] TCP proxy supporting
8 participants