Skip to content
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

skip: kludgy SCION browser support #181

Merged
merged 3 commits into from
Feb 3, 2021
Merged

skip: kludgy SCION browser support #181

merged 3 commits into from
Feb 3, 2021

Conversation

matzf
Copy link
Contributor

@matzf matzf commented Jan 29, 2021

skip (SCION kludge in prowsers, also "ship" in many languages and so fitting with the lighthouse/beacon scheme ⛵) is a poor man's browser integration for SCION.

skip uses a Proxy auto-config file to forward all requests that are go to a SCION destination to a proxy server, running as a (native) binary on the localhost. As this mechanism does not let us support a separate protocol identifier nor allow looking up whether a name refers to a SCION address, we identify SCION addresses as either:

  • the host name of a SCION host with an appended pseudo-TLD .scion, e.g. http://www.scionlab.org.scion, or
  • a mangled SCION address in the form <ISD>-<AS id with underscores>-<host>, e.g. http://17-ffaa_0_1101-129.132.121.164/

To make links and redirects work as intended, i.e. keep using SCION, the proxy replaces matching URLs in the response with these "munged" addresses.

Limitations:

  • Chrome does not appear to honor the PAC (WPAD) configuration, even when it reads it. Not sure why.
  • Does not support HTTPS
  • Does not support WebSockets (HTTP CONNECT) method
  • Does not allow specifiying the protocol (e.g. as scion+http://www.scionlab.org) but instead uses a kludgy pseudo-TLD to
    identify SCION hosts.

Obviously this is not great, but hey, it's a start. Some inspiration for how to to build something more advanced can be found in this extensions for the gopher protocol, OverbiteNX.

Also in this PR:

  • use the gorilla/handlers library as logging middleware in HTTP servers, in the new skip proxy server as well as in _examples/shttp/fileserver.

This change is Reviewable

@matzf matzf force-pushed the matzf/skip branch 2 times, most recently from 0b018cc to a578eaa Compare January 29, 2021 22:20
Add a local web-proxy and a proxy auto-config script to act as a poor
man's SCION browser support.

Please see skip/README.md for details.

Also, use the gorilla/handlers library as logging middleware in HTTP
servers, in the new skip proxy server as well as in
_examples/shttp/fileserver.
@marcfrei
Copy link
Member


skip/README.md, line 8 at r1 (raw file):

that go to

?

@marcfrei
Copy link
Member


skip/README.md, line 9 at r1 (raw file):

skip uses a [Proxy auto-config](https://en.wikipedia.org/wiki/Proxy_auto-config) file
to forward all requests that are go to a SCION destination to a proxy server,
running as a (native) binary on the localhost.

Or just on localhost?

@marcfrei
Copy link
Member


skip/main.go, line 55 at r1 (raw file):

}

type ProxyHandler struct {

Why is this type exported?

@marcfrei
Copy link
Member


skip/main.go, line 89 at r1 (raw file):

	parts := mungedScionAddr.FindStringSubmatch(host)
	if parts != nil {
		// directly apply mangling as inMangleSCIONAddr

"as in shttp.MangleSCIONAddrURL" or "as in appnet.MangleSCIONAddr"?

@marcfrei
Copy link
Member


skip/main.go, line 60 at r1 (raw file):

func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {

Empty line?

@marcfrei
Copy link
Member


skip/main.go, line 1 at r1 (raw file):

// Copyright 2020 ETH Zurich

When do we usually bump the copyright notices to the next year?

@marcfrei
Copy link
Member


skip/README.md, line 1 at r1 (raw file):

# skip

Do we still want to maintain the new invariant that every app also gets a short section in the main README.md?

@marcfrei
Copy link
Member

:lgtm:

Cool idea, i like how little code it took to implement it.

Copy link
Member

@marcfrei marcfrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained

Copy link
Contributor Author

@matzf matzf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 8 files reviewed, 7 unresolved discussions / 0 of 1 LGTMs obtained, and 1 stale / 0 of 1 approvals obtained


skip/main.go, line 1 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…

When do we usually bump the copyright notices to the next year?

Good catch, thanks 😄 📅

Done.


skip/main.go, line 55 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…

Why is this type exported?

Done.


skip/main.go, line 60 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…

Empty line?

Done.


skip/main.go, line 89 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…

"as in shttp.MangleSCIONAddrURL" or "as in appnet.MangleSCIONAddr"?

Done.


skip/README.md, line 1 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…

Do we still want to maintain the new invariant that every app also gets a short section in the main README.md?

Done.


skip/README.md, line 8 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…
that go to

?

Done, rephrased this a bit.


skip/README.md, line 9 at r1 (raw file):

Previously, marcfrei (Marc Frei) wrote…

Or just on localhost?

Done.

@marcfrei
Copy link
Member

marcfrei commented Feb 2, 2021

:lgtm:

Not super elegant. This approach is showing it's weaknesses ;)
@marcfrei
Copy link
Member

marcfrei commented Feb 3, 2021

Cool that you noticed this case. I don't really mind that the code is starting to get less elegant. I think with the chosen approach it's quite expected that we will accumulate edge cases like this for some time. I would just keep adding them and evaluate later where this will lead us.

@marcfrei
Copy link
Member

marcfrei commented Feb 3, 2021

:lgtm:

@matzf matzf merged commit e194557 into master Feb 3, 2021
@matzf matzf deleted the matzf/skip branch February 3, 2021 14:03
@deatheater01
Copy link

Can the HTTPS issue be solved using an SSL certificate chain? I am not completely sure whether this will solve it.

https://support.dnsimple.com/articles/what-is-ssl-certificate-chain/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants