Documentation
¶
Overview ¶
Package panelpage serves the desk nudge's panel page on 127.0.0.1, behind a Host check and a cookie that a one-use code buys. Any page open in a browser can send a request to 127.0.0.1, so a request is answered only where its Host names this listener, which stops DNS rebinding, and where it carries the cookie, which a cross-site request never does. Jupyter trades its token for a cookie the same way.
Index ¶
Constants ¶
const ( // CodeLifetime is how long a minted code opens the page. The window loads // its URL within it, and a code seen in an argv afterwards opens nothing. CodeLifetime = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
Page serves the built page at / and the watch's routes under /api/.
func (*Page) Listen ¶
Listen serves the page on a port of 127.0.0.1 that the system picks now, until Stop.
func (*Page) Mint ¶
Mint is the page's URL carrying a fresh one-use code, and when the code stops opening it.