thrawn01 / h2c-golang-example Goto Github PK
View Code? Open in Web Editor NEWExample HTTP/2 Cleartext (H2C) server and client in golang
Example HTTP/2 Cleartext (H2C) server and client in golang
Hello @thrawn01
I am from America, is it possible with your knowledge create a HTTP over TCP tunnel to bypass my isp provider , but any data the client need to transfer to the server should be via a new HTTP request ( encode64 ) then server decode the data ?
because my ISP provider blocks the upstream data via HTTP BODY.
It is difficul for me and i can not do it.
i did all the test to check the isp restrictions.
my telegram is : @Trader_Nelson
i will wait your reply.
Using your code, if I make a handler like:
func handler(w http.ResponseWriter, r *http.Request) {
time.Sleep(time.Second * 5)
fmt.Fprintf(w, "This request is served over h2c!")
}
and make two requests at the same time, one returns in 5 seconds, the other one returns in 10 seconds.
I think you need a go
statement like go server.ServeConn
in the example code.
if you try to post against the server:
curl --http2 -d foo localhost:1010
you get
Listening [0.0.0.0:1010]...
2021/01/08 19:45:45 http: response.Write on hijacked connection from fmt.Fprintf (print.go:205)
(and no reply)
ps: curl --http2-prior-knowledge -d foo localhost:1010
does work, it's only when upgrading that something happens to the response writer... I think it's because the body is supposed to become bi directional but I haven't figured that out yet
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.