-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: x/tools/present: support being reverse proxied from https #21921
Comments
Why do you want this? Do you want this for using Also, are you aware of https://talks.godoc.org/? If not, does that help you achieve what you want to do? |
CC @campoy |
@shurcooL want using present locally with https |
Since using HTTPS requires a TLS certificate (it could be self-signed, but that would display a red warning message that "the authenticity of this page cannot be verified", etc.), are you planning on bringing your own certificate to use with Doing the above seems pretty involved, and I'm not sure what the benefits would be. If you bind using the I'm not against this, I just want to understand the benefits and motivation better. |
@shurcooL I just use reverse proxy to handle https,like caddy/nginx
but present play.js ,use fixed ws:// protocol so ,if src/golang.org/x/tools/cmd/present/local.go
origin := &url.URL{Scheme: “http or https”} src/golang.org/x/tools/godoc/static/static.go |
I see. Is your end goal to expose the present tool's output at an internet website (e.g., If so, I think it should absolutely support proxying from wss:// to ws:// protocol, does it not? /cc @mholt It should be very similar to reverse proxying external https:// traffic to your local backend via http:// (as far as I understand). |
@shurcooL yes,expose the present to https website. |
Just skimming this issue before I go to sleep, so forgive me if I've missed something; but I think you'll need to use |
@mholt you are right! so I think problem is present's javascript(src/golang.org/x/tools/godoc/static/playground.js) , should detetive location.protocol to new WebSocket using ws:// or wss:// ,
and src/golang.org/x/tools/cmd/present/local.go, should supply a new flag to assign protocol(http or https) |
You're right, the JavaScript will need to be updated to be able to connect to wss://, since that's what the reverse proxy will expose. |
@ddatsh Would it be more accurate to rename this issue from "support https" to "support being reverse proxied from https" or so? We don't need to add full fledged support for https (which comes with a lot of overhead and doesn't have meaningful benefits) to present tool to resolve your issue. We just need to add support for its output being proxied and accessible via https/wss. These would be much less invasive changes, and therefore much easier to accept. |
Yes, it seems like we should support having it behind a reverse proxy. |
found can just modify caddyFile like
but still need modify godoc/static/playground.js
|
CL 96295 mentions this issue. |
Change https://golang.org/cl/96295 mentions this issue: |
Thank you @ddatsh for addressing review comments and resolving this issue! |
Fixes golang/go#21921 Change-Id: Idc6ff2773dcef7210ce4d0eecb7affb357a213b5 GitHub-Last-Rev: 50b959e9b6f2f1513235c5ca0124d80b487c5296 GitHub-Pull-Request: golang/tools#26 Reviewed-on: https://go-review.googlesource.com/96295 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Proposal
What did you do?
found
src/golang.org/x/tools/cmd/present/local.go:62
origin := &url.URL{Scheme: “http”}
fixed, not support https
src/golang.org/x/tools/godoc/static/static.go:2347
var websocket = new WebSocket(‘ws://’ + window.location.host + ‘/socket’);
fixed ws://,not support https
What did you expect to see?
support https access
The text was updated successfully, but these errors were encountered: