Added a simple http server
This will later be used for serving false contentexperimental
parent
011feaf557
commit
8930f00748
|
|
@ -31,7 +31,11 @@ import (
|
|||
"time"
|
||||
"fmt"
|
||||
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
|
||||
type siteList struct {
|
||||
location string
|
||||
|
|
@ -147,6 +151,8 @@ func main() {
|
|||
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