parent
e2eb14dbc8
commit
75207c51df
|
|
@ -31,7 +31,11 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"fmt"
|
"fmt"
|
||||||
sysos "jbreich/rhosts/sys"
|
sysos "jbreich/rhosts/sys"
|
||||||
|
"jbreich/rhosts/serve"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var Exit chan bool
|
||||||
|
|
||||||
// siteList holds the location of all the sites along with a list of their location
|
// siteList holds the location of all the sites along with a list of their location
|
||||||
type siteList struct {
|
type siteList struct {
|
||||||
location string
|
location string
|
||||||
|
|
@ -147,6 +151,8 @@ func main() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
serve.Start("blank")
|
||||||
|
<- Exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Provides the web server for rhosts to relay altered content
|
||||||
|
package serve
|
||||||
|
|
||||||
|
import(
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Start(certLoc string) {
|
||||||
|
go httpServer()
|
||||||
|
//go httpsServer(&certLoc)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func httpServer() (err error){
|
||||||
|
err = http.ListenAndServe("127.0.0.1:80",http.HandlerFunc(httpHandler))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func httpsServer(certLoc *string) (err error){
|
||||||
|
err = http.ListenAndServeTLS("127.0.0.1:80",*certLoc + "ca.crt", *certLoc + "ca.key",http.HandlerFunc(httpHandler))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func httpHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
http.Error(w,"Test",200)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue