上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: ```go package main import ( "crypto/tls" "fmt" "net/smtp" ) func main() { var email string fmt.Println("Enter username for smtp: ") fmt.Scanln(&email) var pass string fmt.Println("Enter p... 阅读全文
posted @ 2018-03-24 00:03 cucy_to 阅读(140) 评论(0) 推荐(0)
摘要: ```go package main import ( "encoding/json" "fmt" "io" "io/ioutil" "net/http" "strconv" "strings" ) const addr = "localhost:7070" type City struct { I 阅读全文
posted @ 2018-03-24 00:01 cucy_to 阅读(99) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "net/http" ) const addr = "localhost:7070" type RedirecServer struct { redirectCount int } func (s *RedirecServer) ServeHTTP(rw http.ResponseWriter, req *htt... 阅读全文
posted @ 2018-03-24 00:00 cucy_to 阅读(210) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "net/http" ) func main() { header := http.Header{} // Using the header as slice header.Set("Auth-X", "abcdef1234") header.Add("Auth-X", "defghijkl") fmt.P... 阅读全文
posted @ 2018-03-23 23:58 cucy_to 阅读(151) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "io/ioutil" "net/http" "net/url" "strings" ) type StringServer string func (s StringServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) { req.Parse... 阅读全文
posted @ 2018-03-23 23:57 cucy_to 阅读(112) 评论(0) 推荐(0)
摘要: ```go package main import ( "encoding/json" "fmt" "net/url" ) func main() { u := &url.URL{} u.Scheme = "http" u.Host = "localhost:80" u.Path = "index.html" u.RawQuery = "id=1&name=John" u.... 阅读全文
posted @ 2018-03-23 23:55 cucy_to 阅读(150) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "io/ioutil" "net/http" "net/url" "strings" ) type StringServer string func (s StringServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) { req.Parse... 阅读全文
posted @ 2018-03-23 23:52 cucy_to 阅读(150) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "net" ) func main() { // Resolve by IP addrs, err := net.LookupAddr("127.0.0.1") if err != nil { panic(err) } for _, addr := range addrs { fmt.Println... 阅读全文
posted @ 2018-03-23 23:50 cucy_to 阅读(114) 评论(0) 推荐(0)
摘要: ```go package main import ( "bufio" "context" "fmt" "io" "net" "net/http" "time" ) type StringServer string func (s StringServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) { rw.... 阅读全文
posted @ 2018-03-23 23:49 cucy_to 阅读(102) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "net" ) func main() { // Get all network interfaces interfaces, err := net.Interfaces() if err != nil { panic(err) } for _, interf := range interfaces ... 阅读全文
posted @ 2018-03-23 23:46 cucy_to 阅读(277) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页