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

[WIP] feature/SCION HTTP endpoints and Webview #167

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix small issues
martenwallewein committed Sep 6, 2020
commit 5fa885956335315bfd9135e39c6ed1401c751e28
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -33,9 +33,9 @@ setup_lint:
@# Install golangci-lint (as dumb as this looks, this is the recommended way to install)
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $$(go env GOPATH)/bin v1.26.0

lint:
@type golangci-lint > /dev/null || ( echo "golangci-lint not found. Install it manually or by running 'make setup_lint'."; exit 1 )
golangci-lint run --build-tags=$(TAGS)
# lint:
# @type golangci-lint > /dev/null || ( echo "golangci-lint not found. Install it manually or by running 'make setup_lint'."; exit 1 )
# golangci-lint run --build-tags=$(TAGS)

install: all
# Note: install everything but the examples
87 changes: 0 additions & 87 deletions _examples/shttp/proxy/mainApi.go

This file was deleted.

2 changes: 1 addition & 1 deletion webapp/web/template/webview.html
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ <h4><b>DVB-T2 Live Stream</b></h4>
}),
timeout : 10000,
success : function(data, textStatus, jqXHR) {
document.getElementById('webview').src = 'http://localhost:8000/__proxy/' + sContext; //remote;
document.getElementById('webview').src = 'http://localhost:8000/__proxy' + sContext; //remote;
},
error : function(jqXHR, textStatus, errorThrown) {
console.error(this.url + ' ' + textStatus + ': ' + errorThrown);
6 changes: 3 additions & 3 deletions webapp/webapp.go
Original file line number Diff line number Diff line change
@@ -123,13 +123,13 @@ func setRemote(remote *string) {
log.Crit("Failed to create SCION reverse proxy %s", err)
}

log.Info("Proxy to SCION remote %s\n", *remote)
fmt.Printf("Proxy to SCION remote %s\n", *remote)
} else {
u, err := url.Parse(*remote)
if err != nil {
log.Crit(fmt.Sprintf("Failed parse remote %s, %s", *remote, err))
}
log.Info("Proxy to HTTP remote %s\n", *remote)
fmt.Printf("Proxy to HTTP remote %s\n", *remote)
proxy = httputil.NewSingleHostReverseProxy(u)
}
}
@@ -272,7 +272,7 @@ func initServeHandlers() {
http.HandleFunc("/gettrc", getTrcInfoHandler)

http.HandleFunc("/__proxy/setconfig", setProxyConfig)
http.HandleFunc("/__proxy", proxyWrapper)
http.HandleFunc("/__proxy/", proxyWrapper)
}

func logRequestHandler(handler http.Handler) http.Handler {