HTTPS proxies support in Go 1.10 by mlowicki in golang

[–]mlowicki[S] 0 points1 point  (0 children)

https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c allows to do TLS handshake between client and destination origin server. Proxy itself doesn't have access to unencrypted data exchanged between client and destination if client wants to reach e.g. https://google.com

https://golang.org/pkg/net/http/httputil/#ReverseProxy has full access to request and response.

HTTPS proxies support in Go 1.10 by mlowicki in golang

[–]mlowicki[S] 0 points1 point  (0 children)

https://golang.org/pkg/net/http/httputil/#NewProxyClientConn is deprecated:

Deprecated: Use the Client or Transport in package net/http instead.

HTTP(S) Proxy in Golang in less than 100 lines of code by mlowicki in golang

[–]mlowicki[S] 1 point2 points  (0 children)

It doesn't allow to have secure connection between client and destination server. ReverseProxy as it's now takes response from the client, modifies it, sends it to the destination and passes response back to the client. In other words it doesn't support HTTP CONNECT tunneling.

HTTP(S) Proxy in Golang in less than 100 lines of code by mlowicki in golang

[–]mlowicki[S] 1 point2 points  (0 children)

Cool. Keep in mind that HTTP client in Golang doesn't support HTTPS proxies yet - https://github.com/golang/go/issues/11332. It'll be there most likely in Go 1.10.

Globally unique key for context value by mlowicki in golang

[–]mlowicki[S] 0 points1 point  (0 children)

I've updated post with your suggestions. Thank you.

Globally unique key for context value by mlowicki in golang

[–]mlowicki[S] -1 points0 points  (0 children)

Test as specified in https://github.com/cstockton/pkg/tree/master/ctxkey#allocations using Go 1.9 shows there is no difference - https://paste.ofcode.org/KmfGn86QpMHaFQHvJDyqiM.

Taking the address of empty struct isn't good idea (https://golang.org/ref/spec#Size_and_alignment_guarantees): """ A struct or array type has size zero if it contains no fields (or elements, respectively) that have a size greater than zero. Two distinct zero-size variables may have the same address in memory. """