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

The method ListenAndServe in package http3 is not compatible with http #4521

Closed
ETZhangSX opened this issue May 14, 2024 · 4 comments · Fixed by #4522
Closed

The method ListenAndServe in package http3 is not compatible with http #4521

ETZhangSX opened this issue May 14, 2024 · 4 comments · Fixed by #4522

Comments

@ETZhangSX
Copy link
Contributor

The method ListenAndServe in package http3 is not compatible with the method in built-in package http

func ListenAndServe(addr, certFile, keyFile string, handler http.Handler) error {

The definitions in http are

func ListenAndServe(addr string, handler Handler) error
func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error

Maybe we should rename it to ListenAndServeTLS ?

@marten-seemann
Copy link
Member

We could, but what's the advantage of that?

@ETZhangSX
Copy link
Contributor Author

Maybe for compatibility upgrade from http1/2 to http3, which can just change the package name.

@marten-seemann
Copy link
Member

I doubt this would be the only change needed. For anything but the simplest use case, you'd set up a http.Server anyway. But I'm ok to change this, as long you don't remove, but only deprecate the old function. Want to send a PR?

@ETZhangSX
Copy link
Contributor Author

OK, I will send a PR.

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 a pull request may close this issue.

2 participants