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

Support requesting subdomains on SSH #4

Closed
antoniomika opened this issue Mar 21, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@antoniomika
Copy link
Owner

commented Mar 21, 2019

Support SSH remote address setting to force a specific subdomain:

i.e. ssh -R foo:80:localhost:80 ssi.sh will allocate foo.ssi.sh as long as it is available.

Addr string

is the specific location where this comes into play. Just needs to be set around this piece of code:

sish/requests.go

Lines 79 to 99 in a85d664

if stringPort == "80" || stringPort == "443" {
scheme := "http"
if stringPort == "443" {
scheme = "https"
}
host := strings.ToLower(RandStringBytesMaskImprSrc(*domainLen) + "." + *rootDomain)
pH := &ProxyHolder{
ProxyHost: host,
ProxyTo: chanListener.Addr().String(),
Scheme: scheme,
}
state.HTTPListeners.Store(host, pH)
defer state.HTTPListeners.Delete(host)
sshConn.Messages <- fmt.Sprintf("HTTP requests for 80 and 443 can be reached on host: %s", host)
} else {
sshConn.Messages <- fmt.Sprintf("Connections being forwarded to %s:%d", *rootDomain, chanListener.Addr().(*net.TCPAddr).Port)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.