예제 #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()
}
예제 #2
0
func main() {
	flag.Parse()

	port := magicport.NewPort("tcp", *bind)
	port.AddInterface(magicport.NewAnyPortInterface([]byte{}, []byte(*key)))
	port.ListenAndServe()
}
예제 #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()
}
예제 #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()
}