Beispiel #1
0
func main() {
	port := magicport.NewPort("tcp", "127.0.0.1:8080")
	inter := magicport.NewRawMatchInterface("220.166.52.189:80", []byte("/oj"), 4)
	port.AddInterface(inter)
	port.AddInterface(magicport.NewRedirectInterface("127.0.0.1:8000"))
	port.ListenAndServe()
}
Beispiel #2
0
func main() {
	flag.Parse()

	port := magicport.NewPort("tcp", *bind)
	port.AddInterface(magicport.NewAnyPortInterface([]byte{}, []byte(*key)))
	port.ListenAndServe()
}
Beispiel #3
0
func main() {
	port := magicport.NewPort("tcp", "127.0.0.1:8080")
	inter := magicport.NewRegexMatchInterface(
		"220.166.52.189:80", "^(GET|POST) /oj/", []byte("\r\n"), 0)
	port.AddInterface(inter)
	port.AddInterface(magicport.NewRedirectInterface("127.0.0.1:8000"))
	port.ListenAndServe()
}
Beispiel #4
0
func main() {
	log.Printf("start")
	port := magicport.NewPort("tcp", "127.0.0.1:8080")
	port.AddInterface(magicport.NewRedirectInterface("127.0.0.1:8000"))
	port.ListenAndServe()
}