{"id":197570,"date":"2013-10-15T11:52:02","date_gmt":"2013-10-15T07:52:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=197570"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=197570","title":{"rendered":"<span class=\"post_title\">\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430 Go \u0432 200 \u0441\u0442\u0440\u043e\u043a<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u042f <a href=\"http:\/\/habrahabr.ru\/post\/197468\/#comment_6849220\">\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b<\/a>, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430 Go, \u0445\u043e\u0442\u044f \u0435\u0441\u0442\u044c \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c ngnix. <\/p>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u043e, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445 \u043b\u044e\u0434\u0438 \u0431\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0440\u0443\u044e\u0442, \u043e \u0447\u0435\u043c \u0443\u0433\u043e\u0434\u043d\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0442\u043e-\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438 \u044f \u0431\u0440\u0435\u0448\u0443 \u0438 \u043d\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430 Go. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u0434 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u0441\u0440\u0430\u0437\u0443. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u201c\u043e\u0441\u043e\u0431\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438\u201d \u0437\u0430 4 \u0447\u0430\u0441\u0430, \u0438 \u043f\u043e\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 2 \u043d\u0435\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0430\u043a, \u043a\u0430\u043a \u201c\u0432\u0441\u0435\u201d \u0431\u044b\u043b\u0438 \u0432 \u0413\u0440\u0435\u0446\u0438\u0438. \u041a\u043e\u0434 \u043d\u0435 \u043a\u0440\u0430\u0441\u0438\u0432 \u0438 \u0434\u0430\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b, \u0442\u043e \u0443\u0436\u0435 \u0447\u0435\u0433\u043e \u0442\u043e \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u0447\u0442\u0438 \u043e\u0440\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u043e\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a. \u042f \u0443\u0431\u0440\u0430\u043b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043a\u043e\u0434 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0443\u043a. <br \/>  <a name=\"habracut\"><\/a><\/p>\n<pre><code class=\"go\">package main \/\/ (c) http:\/\/habrahabr.ru\/users\/pyra\/ BSD license  import ( \t\/\/\t&quot;encoding\/json&quot; \t&quot;fmt&quot; \t\/\/\t&quot;io&quot; \t&quot;io\/ioutil&quot; \t&quot;log&quot; \t&quot;time&quot; \t&quot;net\/http&quot; \t&quot;net\/url&quot; \t\/\/\t&quot;os&quot; \t\/\/\t&quot;sort&quot; \t&quot;strconv&quot; \t&quot;strings&quot; \t\/\/\t&quot;time&quot; \t&quot;errors&quot; )  func main() {  \t\/\/http.HandleFunc(&quot;\/r&quot;, handle_redir) \t\/\/http.Handle(&quot;\/extrahtml\/&quot;, http.FileServer(http.Dir(&quot;.\/extrahtml\/&quot;))) \thttp.HandleFunc(&quot;\/googleXXXXXXXXXXXX.html&quot;, handle_google) \thttp.HandleFunc(&quot;\/&quot;, handle_def)  \thttps1 := &http.Server{ \t\tAddr:           &quot;:8443&quot;, \t\tHandler:        nil, \t\tReadTimeout:    20 * time.Second, \t\tWriteTimeout:   20 * time.Second, \t\tMaxHeaderBytes: 1 &lt;&lt; 15, \t}  \tgo func() { \t\tlog.Fatal(https1.ListenAndServeTLS(&quot;device.crt&quot;, &quot;device.key&quot;)) \t}()  \thttp1 := &http.Server{ \t\tAddr:           &quot;:8080&quot;, \t\tHandler:        nil, \t\tReadTimeout:    20 * time.Second, \t\tWriteTimeout:   20 * time.Second, \t\tMaxHeaderBytes: 1 &lt;&lt; 15, \t}  \thttp1.ListenAndServe() }  var reqcntr int var opencntr int  func redirectPolicyFunc(req *http.Request, via []*http.Request) error { \te := errors.New(&quot;redirect&quot;) \treturn e } func handle_google(w http.ResponseWriter, r *http.Request) { \tfmt.Println(&quot;google&quot;) \tb, _ := ioutil.ReadFile(&quot;googleXXXXXXXXXXXXXXXX.html&quot;) \tfmt.Println(len(b)) \tw.Write(b) }  func handle_def(w http.ResponseWriter, r *http.Request) { \t\/\/ \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \topencntr++ \tdefer func() { \t\topencntr-- \t}() \tclient := &http.Client{ \t\tCheckRedirect: redirectPolicyFunc, \t} \tip := strings.Split(r.RemoteAddr, &quot;:&quot;)[0]  \t\/\/ \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u0431\u0435\u0437 \u043c\u044e\u0442\u0435\u043a\u0441\u043e\u0432) \treqcntr++ \tq := r.URL.RawQuery \t\/\/fmt.Println(&quot;def &quot;, r.Method, reqcntr, q) \t\/\/r.Form, _ = url.ParseQuery(r.URL.RawQuery) \t\/\/io.WriteString(w, r.URL.Path) \tpath := r.URL.Path \t \t\/\/ ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0443\u0442 \tvar cid int64\t \t \t\/\/ \u043f\u043e\u043c\u0435\u0442\u0438\u043c \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u041f\u0425\u041f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \tbreporting := false \t \t\/\/ \u041f\u0425\u041f \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \tif strings.HasSuffix(path, &quot;.php&quot;) { \/\/\t\tfmt.Println(&quot;breporting = true&quot;) \t\tbreporting = true \t} \t \t\/\/ \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u041f\u0425\u041f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \tif path == &quot;\/ajax\/main.php&quot; { \t\tpath = &quot;\/ajax\/main_hide1777.php&quot; \t}  \tcid = -2 \tif strings.HasPrefix(path, &quot;\/ajax\/&quot;) || strings.HasPrefix(path, &quot;\/im\/&quot;) { \t\t\/\/ \u0444\u0430\u0439\u043b\u044b \u0432 \u0441\u043b\u0435\u0434 \u043f\u0430\u043f\u043a\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \t\t \t\tm, err := url.ParseQuery(q) \t\tif err == nil { \t\t\tid := m.Get(&quot;xid&quot;) \t\t\tif id == &quot;&quot; { \t\t\t\tid = m.Get(&quot;aid&quot;) \t\t\t\tif id == &quot;&quot; { \t\t\t\t\tid = m.Get(&quot;cid&quot;) \t\t\t\t\tif id == &quot;&quot; { \t\t\t\t\t\tid = m.Get(&quot;bid&quot;) \t\t\t\t\t} \t\t\t\t} \t\t\t} \t\t\tcid, err = strconv.ParseInt(id, 10, 64) \t\t\tif err != nil { \t\t\t\tcid = -1 \t\t\t} \t\t} \t} else if strings.HasPrefix(path, &quot;\/avatar\/&quot;) { \t\t\/\/ \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0430 \u0442\u043e\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0418\u0414 \/avatar\/1234.gif  \t\t\/\/ ID - 1234 \t\t \t\tcid = -1 \t\tpos1 := strings.Index(path[8:], &quot;.&quot;) \t\tif pos1 != -1 { \t\t\tid := path[6 : pos1+6] \t\t\tvar err error \t\t\tcid, err = strconv.ParseInt(id, 10, 64) \t\t\tif err != nil { \t\t\t\tcid = -1 \t\t\t} \t\t} \t} \t\/\/ \u0442\u0443\u0442 \u0431\u044b\u043b \u0435\u0449\u0451 \u043e\u0434\u0438\u043d else \u0433\u0434\u0435 \u0445\u0438\u0442\u0440\u043e \u0434\u0435\u043a\u0440\u0438\u043f\u0442\u0438\u043b\u0438\u0441\u044c \u043a\u0443\u043a\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430  \t\/\/ \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u043e\u043c\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \t\/\/host := &quot;test000.cloud&quot; \thost := &quot;login.yahoo.com&quot; \/\/ \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u0430\u0442\u0440\u0435\u0442\u044c \u0447\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0448\u0438\u043a\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430 \tif cid &gt; 1000 && cid &lt; 5000 { \t\thost = &quot;prod002.cloud&quot; \t} else if cid &gt;= 5000 && cid &lt; 7000 { \t\thost = &quot;prod003.cloud&quot; \t} else if cid &gt;= 7000 && cid &lt; 15000 { \t\thost = &quot;prod005.cloud&quot; \t} else if cid &gt;= 15000 && cid &lt; 16000 { \t\thost = &quot;prod006.cloud&quot; \t} else if cid &gt;= 25000 && cid &lt; 34000 { \t\thost = &quot;prod011.cloud&quot; \t}  \turl := &quot;&quot; \t\/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 IP \u0432 \u0443\u0440\u043b\u0435 \u0442\u0430\u043a \u043a\u0430\u043a PHP 5.3 FastCGI \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0445\u0435\u0434\u0435\u0440\u044b \u0447\u0438\u0442\u0430\u0442\u044c \tif breporting { \t\turl = &quot;https:\/\/&quot; + host + path + &quot;?&quot; + q + &quot;&HEHE_IP=&quot;+ip+&quot;&HEHE_SECRET=B87BVf5&quot; \t}else{ \t\turl = &quot;https:\/\/&quot; + host + path + &quot;?&quot; + q \t} \tfmt.Println(url) \t \t\/\/ \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e GET \u0437\u0430\u043f\u0440\u043e\u0441\u044b \tif r.Method == &quot;GET&quot; { \t\treq1, err := http.NewRequest(&quot;GET&quot;, url, nil) \t\tif err != nil { \t\t\tfmt.Println(&quot;Error1: &quot;, err) \t\t\t\/\/ \u0442\u0443\u0442 \u0447\u0435\u0433\u043e \u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \t\t} \t\treq1.Header = r.Header \t\treq1.Header.Add(&quot;XHEHE_REMOTE_IP&quot;, ip) \t\tresp, _ := client.Do(req1) \t\tStatusCode := resp.StatusCode \t\tdefer resp.Body.Close() \t\tbody, err := ioutil.ReadAll(resp.Body) \t\tif err != nil { \t\t\tfmt.Println(&quot;Error2: &quot;, err) \t\t\t\/\/ \u0438 \u0442\u0443\u0442 )))) \t\t\t\/\/ \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \t\t} \t\tfmt.Println(&quot;def &quot;, r.Method, reqcntr, opencntr, url, len(body), StatusCode) \t\tfor k1, v1 := range resp.Header { \t\t\tfor _, v2 := range v1 { \t\t\t\tw.Header().Add(k1, v2) \t\t\t} \t\t} \t\tw.WriteHeader(StatusCode) \t\tw.Write(body) \t} } \/\/ 190 \u0441\u0442\u0440\u043e\u043a \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d. \u0412 \u043d\u0435\u043c \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0438\u0434\u0435\u0438 \u0438\u0437 \u043c\u043e\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u044c\u0438. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044e \u0442\u043e\u0433\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438 \u043e\u0442\u0447\u0435\u0442\u044b, API \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (\u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439). \u0418 \u0432\u043e\u0442 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u0438\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0442\u0430\u043a \u0436\u0435 \u0432 \u0431\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u043a\u0438, \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0444\u0430\u0439\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0435\u0437 \u0444\u043e\u0442\u043e\u043a \u044d\u0442\u043e ~10\u041a\u0411. \u0421\u0435\u0440\u0432\u0435\u0440 \u0410 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0444\u0430\u0439\u043b, \u0444\u0430\u0439\u043b \u0441\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f, \u0444\u0430\u0439\u043b \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0411, \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0443 \u0438\u043b\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0448\u0438\u043a\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0411.<\/p>\n<p>  \u041c\u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c Go \u0438 ngnix. \u041f\u043e\u043d\u044f\u0442\u043d\u043e ngnix \u0431\u044b\u0441\u0442\u0440\u0435\u0439, \u043d\u043e \u0435\u0441\u043b\u0438 ngnix \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0434\u0440\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u0442 300 \u0438\u043b\u0438 500 \u043c\u0431\u0438\u0442, \u0430 Go \u0442\u043e\u043b\u044c\u043a\u043e 50 \u043c\u0431\u0438\u0442, \u0442\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430 \u0443 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0437\u0430 5 \u0431\u0430\u043a\u0441\u043e\u0432 \u0443 \u0442\u043e\u0433\u043e \u0436\u0435 DigitalOcean, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0435\u043d\u044c\u0433\u0430\u0445? \u0410 \u0432\u0434\u0440\u0443\u0433 Go \u043c\u043e\u0436\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 1\u043c\u0431\u0438\u0442? \u0412\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0440\u0435\u0448\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a, \u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u0442\u043e \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u0440\u0430\u0437\u043d\u044b\u0439, \u043d\u043e \u0438 \u0442\u043e \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u043b\u044f \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 Go. \u0412\u043c\u0435\u0441\u0442\u043e http.NewRequest \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c time.Sleep. \u0418\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0448\u0438\u043a\u043e\u0432.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/197570\/\"> http:\/\/habrahabr.ru\/post\/197570\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u042f <a href=\"http:\/\/habrahabr.ru\/post\/197468\/#comment_6849220\">\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b<\/a>, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430 Go, \u0445\u043e\u0442\u044f \u0435\u0441\u0442\u044c \u043c\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c ngnix. <\/p>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u043e, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445 \u043b\u044e\u0434\u0438 \u0431\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0440\u0443\u044e\u0442, \u043e \u0447\u0435\u043c \u0443\u0433\u043e\u0434\u043d\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0442\u043e-\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438 \u044f \u0431\u0440\u0435\u0448\u0443 \u0438 \u043d\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430 Go. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u0434 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u0441\u0440\u0430\u0437\u0443. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u201c\u043e\u0441\u043e\u0431\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438\u201d \u0437\u0430 4 \u0447\u0430\u0441\u0430, \u0438 \u043f\u043e\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 2 \u043d\u0435\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0430\u043a, \u043a\u0430\u043a \u201c\u0432\u0441\u0435\u201d \u0431\u044b\u043b\u0438 \u0432 \u0413\u0440\u0435\u0446\u0438\u0438. \u041a\u043e\u0434 \u043d\u0435 \u043a\u0440\u0430\u0441\u0438\u0432 \u0438 \u0434\u0430\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b, \u0442\u043e \u0443\u0436\u0435 \u0447\u0435\u0433\u043e \u0442\u043e \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u0447\u0442\u0438 \u043e\u0440\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u043e\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a. \u042f \u0443\u0431\u0440\u0430\u043b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043a\u043e\u0434 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0443\u043a.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-197570","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/197570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=197570"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/197570\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=197570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=197570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=197570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}