Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProxyHandler ¶
ProxyHandler is used to create a CORS proxy.
If ProxyHandler is being used on the Internet domain ‘example.com’, then a request to:
http://example.com/http://something.tld/blog/feed.atom
Would make a server-side request to:
http://something.tld/blog/feed.atom
And request the response with the addition of two headers:
Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT, TRACE
Example usage:
var handler http.Handler = &cors.ProxyHandler{ LogWriter: os.Stdout, } err := http.ListenAndServe(addr, handler)
func (*ProxyHandler) ServeHTTP ¶
func (receiver *ProxyHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.