Git Product home page Git Product logo

Comments (6)

Glonee avatar Glonee commented on September 22, 2024

You can create a http3.Server. It has a ListenAndServe method that you want.

from quic-go.

lunarlettuce avatar lunarlettuce commented on September 22, 2024

As far as I can tell, that only sets up listeners for UDP, which would only be half of what the standalone function does.

I have tried using the ListenAndServe function under http3.Server, but it doesn't seem to accept any connections, with all requests being dropped with "Connection refused".

from quic-go.

marten-seemann avatar marten-seemann commented on September 22, 2024

For the TCP part, you can use the standard library. The top-level functions are only convenience wrappers anyway.

from quic-go.

Glonee avatar Glonee commented on September 22, 2024

A simple example

h3server := http3.Server{
	Handler:   handler,
	TLSConfig: tlsCfg,
}
server := http.Server{
	Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		h3server.SetQuicHeaders(w.Header())
		h3server.Handler.ServeHTTP(w, r)
	}),
	TLSConfig: h3server.TLSConfig,
}
go server.ListenAndServeTLS("", "")
h3server.ListenAndServe()

from quic-go.

lunarlettuce avatar lunarlettuce commented on September 22, 2024

Much appreciated @Glonee, thank you.

from quic-go.

lunarlettuce avatar lunarlettuce commented on September 22, 2024

@Glonee Out of curiosity, would you happen to know why your example throws
WARNING: Could not save SSL session data for socket 3
when connecting with wget?

from quic-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.