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

Q: use case for caching proxy #137

Closed
ivanjaros opened this issue Oct 11, 2020 · 6 comments
Closed

Q: use case for caching proxy #137

ivanjaros opened this issue Oct 11, 2020 · 6 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested waiting for response waiting for the response from commenter

Comments

@ivanjaros
Copy link

I will be making a caching proxy soon where user sends a HTTP/S request and i either serve the locally cached content or fetch it from origin, cache it and serve it. So I am wondering if this would be a good library to use instead of built-in net package to yield some more performance?

Secondly, HTTPS/TLS is a must and I saw that you do not use tidwall's evio, at least not any more, which does not support TLS. But also this looks like #16 TLS might still not be supported here, so what is the situation?

@ivanjaros ivanjaros added help wanted Extra attention is needed question Further information is requested labels Oct 11, 2020
@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/panjf2000/gnet

@panjf2000
Copy link
Owner

I will be making a caching proxy soon where user sends a HTTP/S request and i either serve the locally cached content or fetch it from origin, cache it and serve it. So I am wondering if this would be a good library to use instead of built-in net package to yield some more performance?

I think gnet would be a good choice for developers to implement a proxy server.

Secondly, HTTPS/TLS is a must and I saw that you do not use tidwall's evio, at least not any more, which does not support TLS. But also this looks like #16 TLS might still not be supported here, so what is the situation?

Supporting TLS is a gigantic feature for gnet, which takes lots of effort and I currently don't have time for this, also I had been wondering if making a full implementation of TLS in gnet is a good idea, maybe I ought to design it as a plug-in architecture where developers are able to implement their plugins for their custom requirements.

@panjf2000 panjf2000 added the waiting for response waiting for the response from commenter label Oct 14, 2020
@ivanjaros
Copy link
Author

ok, thanks for the info. i know tidwall said that he does not support tls because core tls library depends on net.Conn, iirc. if the tls "plugin" would be a simple ReadWriter like compressors and marshallers can be, that would be the most universal solution, i think. i will probably look into it once i begin the work, though it is highly possible that due to this i will have to take the go std route for now and look at gnet for v2 later on. since getting the working solution out as fast as possible will be priority.

@ivanjaros
Copy link
Author

actually, i have a better idea. it might sound a bit too crazy but i think it would make more sense to just fork Go and simply replace the std net package's internals with gnet. That way there would be no compatibility issue and no need to write tls/http/http2/http3/quic plugins. and maybe in time it could be merged into Go if it proves to be "worthy".

@panjf2000
Copy link
Owner

panjf2000 commented Oct 14, 2020

actually, i have a better idea. it might sound a bit too crazy but i think it would make more sense to just fork Go and simply replace the std net package's internals with gnet. That way there would be no compatibility issue and no need to write tls/http/http2/http3/quic plugins. and maybe in time it could be merged into Go if it proves to be "worthy".

I don't think that will work, gnet has a completely different interface design than go and a lot less functionality, they are totally incompatible, so there is no way that gnet can be a substitute for go std net.

@ivanjaros
Copy link
Author

ok, you know best. thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested waiting for response waiting for the response from commenter
Projects
None yet
Development

No branches or pull requests

2 participants