Comments (6)
I found that http3.Server
has ServeQUICConn
method on it which relays the connection to the http.Handler
provided. So I can just open a quic.Listener
, accept connections on that listener, and relay the connection to http.Handler
. But now the question is, how do I distinguish the intent of this connection? Because if this is a /stream
request, I shouldn't relay it to http.Handler
. And I don't see a nice way to access the headers such as :path
.
from quic-go.
Headers are parsed into an http.Request
. If you want to use a non-HTTP protocol, you can use ALPN.
from quic-go.
But I don't have access to the underlying QUIC connection in my http.Handler
to open a stream do I?
from quic-go.
That’s what ServeQUICConn is there for. The connection will only end up in the HTTP/e package if the ALPN is h3.
from quic-go.
Here is what I tried to do:
listener, err := quic.ListenAddrEarly(":8080", tlsConfig, &quic.Config{
EnableDatagrams: true,
Allow0RTT: true,
})
if err != nil {
return err
}
go func() {
for {
conn, err := listener.Accept(context.Background())
if err != nil {
slog.Error("Failed to accept connection", "err", err)
continue
}
slog.Info("Accepted connection", "remoteAddr", conn.RemoteAddr())
}
}()
s.h3.ServeListener(listener)
where s.h3
is a *http3.Server
instance.
When I send http3 requests to the /user
endpoint, sometimes http3.Server
captures the request and serves it successfully, but sometimes the quic.EarlyListener
captures the request in the goroutine and client is stuck. How can I make sure that http3 requests are only handled by http3.Server
, and other quic connection requests are captured by the listener? Also just a note that I need both http3.Server
and the quic listener process to share the same Listener instance so that they can be served on the same port.
from quic-go.
There seems to be some confusion about what constitutes a request. HTTP requests are sent on streams, so accepting the connection won’t have any influence on that.
from quic-go.
Related Issues (20)
- quic-go.newStream high memory usage HOT 7
- http3: response body not implemented http3.HTTPStreamer HOT 9
- Datagram no recent network activity error HOT 3
- bug: unable to connect to quiche servers HOT 5
- In some cases I have turned off Stream on the server side, but OpenStreamSync on the client side is still blocked HOT 6
- pass a context to ConnContext context, cancel it when the connection is closed
- Slow transfer speed HOT 10
- Wrong ACK numbers? HOT 1
- gquic branch usage HOT 1
- Go 1.21
- server incorrectly allows 0-RTT with reduced limits when using tls.Config.GetConfigForClient
- introduce a minimum step size of Path MTU Discovery
- Allow applications to specify MaxPacketBufferSize HOT 8
- add more metrics
- Significant Packet Delay with quic-go on iOS Due to Goroutine Handling HOT 3
- http3: RoundTripper is caching dialErr since v0.43.0 HOT 1
- Cancel retransmission of data when sending with quic Client HOT 1
- implement BBRv3 HOT 3
- use `net.ErrClosed` for the server and the connection HOT 3
- [Suggestion] multi-staging build in quic-go example Dockerfile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quic-go.