{"id":30782,"date":"2019-10-31T21:37:25","date_gmt":"2019-10-31T18:37:25","guid":{"rendered":"https:\/\/prohoster.info\/blog\/razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu\/"},"modified":"2019-10-31T21:37:25","modified_gmt":"2019-10-31T18:37:25","slug":"razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu","title":{"rendered":"Zhvillimi i server\u00ebve web me Golang \u2014 nga e thjeshta n\u00eb t\u00eb avancuar","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Zhvillimi i server\u00ebve web me Golang \u2014 nga e thjeshta n\u00eb t\u00eb avancuar\" src=\"\/wp-content\/uploads\/2019\/04\/4ee879ad45f0ed192a15705e20ae00dd.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nPes\u00eb vjet m\u00eb par\u00eb fillova <noindex><a rel=\"nofollow\" href=\"https:\/\/getgophish.com\/\">t\u00eb zhvilloj Gophish<\/a><\/noindex>, kjo m\u00eb dha mund\u00ebsin\u00eb t\u00eb studioj Golang. Kuptova se Go \u00ebsht\u00eb nj\u00eb gjuh\u00eb e fuqishme, mund\u00ebsit\u00eb e s\u00eb cil\u00ebs plot\u00ebsohen nga shum\u00eb biblioteka. Go \u00ebsht\u00eb universale: ve\u00e7an\u00ebrisht, me t\u00eb mund t\u00eb zhvillohet leht\u00ebsisht aplikacione serverike.<\/p>\n<p>Ky artikull i kushtohet shkrimit t\u00eb nj\u00eb serveri me Go. Le t\u00eb fillojm\u00eb me gj\u00ebra t\u00eb thjeshta, si \"Hello world!\", dhe t\u00eb p\u00ebrfundojm\u00eb me nj\u00eb aplikacion me k\u00ebto mund\u00ebsi:<\/p>\n<p>\u2014 P\u00ebrdorimi i Let\u2019s Encrypt p\u00ebr HTTPS.<br \/>\n\u2014 Funksionimi si nj\u00eb API-router.<br \/>\n\u2014 Puna me middleware.<br \/>\n\u2014 Trajtimi i skedar\u00ebve statik\u00eb.<br \/>\n\u2014 Mbyllja e sakt\u00eb e pun\u00ebs.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<blockquote><p><b>Skillbox rekomandon:<\/b> Kurs praktik <noindex><a rel=\"nofollow\" href=\"https:\/\/skillbox.ru\/python\/?utm_source=skillbox.media&amp;utm_medium=habr.com&amp;utm_campaign=PTNDEV&amp;utm_content=articles&amp;utm_term=gowebserver\">\u00abProgramues Python nga zero\u00bb<\/a><\/noindex>.<\/p>\n<p><b>Kujtojm\u00eb:<\/b> <i>p\u00ebr t\u00eb gjith\u00eb lexuesit e \"Habra\" \u2014 zbritje prej 10,000 rublej p\u00ebr regjistrimin n\u00eb \u00e7do kurs Skillbox me kodin promocional \"Habr\".<\/i>\n<\/p><\/blockquote>\n<h3>Hello, world!<\/h3>\n<p>\nKrijimi i nj\u00eb serveri web n\u00eb Go mund t\u00eb b\u00ebhet shum\u00eb shpejt. Ja nj\u00eb shembull i p\u00ebrdorimit t\u00eb nj\u00eb p\u00ebrpunuesi q\u00eb kthen \"Hello, world!\" si\u00e7 u p\u00ebrmend m\u00eb par\u00eb.<\/p>\n<pre><code class=\"go\">package main\n \nimport (\n\"fmt\"\n\"net\/http\"\n)\n \nfunc main() {\nhttp.HandleFunc(\"\/\", func(w http.ResponseWriter, r *http.Request) {\nfmt.Fprintf(w, \"Hello World!\")\n})\nhttp.ListenAndServe(\":80\", nil)\n}<\/code><\/pre>\n<p>\nPas k\u00ebsaj, n\u00ebse e lan\u00e7oni aplikacionin dhe hapni faqen <noindex>localhost<\/noindex>, do t\u00eb shihni menj\u00ebher\u00eb tekstin \"Hello, world!\" (sigurisht, n\u00ebse gjith\u00e7ka funksionon si\u00e7 duhet).<\/p>\n<p>M\u00eb von\u00eb ne do t\u00eb p\u00ebrdorim vazhdimisht menaxherin, por fillimisht le t\u00eb kuptojm\u00eb se si funksionon \u00e7do gj\u00eb.<\/p>\n<h4>net\/http<\/h4>\n<p>\nN\u00eb shembull u p\u00ebrdor paketa <noindex><a rel=\"nofollow\" href=\"https:\/\/golang.org\/pkg\/net\/http\/\"><code>net\/http<\/code><\/a><\/noindex>, q\u00eb \u00ebsht\u00eb mjete kryesore n\u00eb Go p\u00ebr zhvillimin e server\u00ebve dhe klient\u00ebve HTTP. P\u00ebr t\u00eb kuptuar kodin, le t\u00eb shqyrtojm\u00eb kuptimin e tre elementeve t\u00eb r\u00ebnd\u00ebsish\u00ebm: http.Handler, http.ServeMux dhe http.Server.<\/p>\n<h4>Menaxher\u00ebt HTTP<\/h4>\n<p>\nKur marrim nj\u00eb k\u00ebrkes\u00eb, menaxheri e analizon at\u00eb dhe formon nj\u00eb p\u00ebrgjigje. Menaxher\u00ebt n\u00eb Go implementohen si m\u00eb posht\u00eb:<\/p>\n<pre><code class=\"go\">type Handler interface {\n        ServeHTTP(ResponseWriter, *Request)\n}<\/code><\/pre>\n<p>\nN\u00eb shembullin e par\u00eb p\u00ebrdoret funksioni ndihm\u00ebs http.HandleFunc. Ky funksion e mb wrapped nj\u00eb funksion tjet\u00ebr, i cili, nga ana e tij, merr http.ResponseWriter dhe http.Request n\u00eb ServeHTTP.<\/p>\n<p>Me fjal\u00eb t\u00eb tjera, menaxher\u00ebt n\u00eb Golang p\u00ebrfaq\u00ebsohen nga nj\u00eb nd\u00ebrfaqe e vetme, q\u00eb ofron shum\u00eb mund\u00ebsi p\u00ebr programuesin. P\u00ebr shembull, middleware implementohet p\u00ebrmes menaxherit, ku ServeHTTP fillimisht b\u00ebn di\u00e7ka dhe pastaj th\u00ebrret metod\u00ebn ServeHTTP t\u00eb nj\u00eb menaxheri tjet\u00ebr.<\/p>\n<p>Si\u00e7 u p\u00ebrmend m\u00eb sip\u00ebr, menaxher\u00ebt thjesht formulojn\u00eb p\u00ebrgjigje p\u00ebr k\u00ebrkesat. Por cili menaxher duhet t\u00eb p\u00ebrdoret n\u00eb nj\u00eb moment t\u00eb caktuar?<\/p>\n<h4>Rruga e k\u00ebrkesave<\/h4>\n<p>\nP\u00ebr t\u00eb b\u00ebr\u00eb nj\u00eb zgjedhje t\u00eb sakt\u00eb, p\u00ebrdorni HTTP-multiplexorin. N\u00eb disa biblioteka, ai quhet muxer ose router, por t\u00eb gjith\u00eb jan\u00eb nj\u00ebsoj. Funksioni i multiplexorit \u00ebsht\u00eb analiza e rrug\u00ebs s\u00eb k\u00ebrkes\u00ebs dhe zgjedhja e trajtuesit p\u00ebrkat\u00ebs.<\/p>\n<p>N\u00ebse \u00ebsht\u00eb e nevojshme mb\u00ebshtetje p\u00ebr ruterim t\u00eb komplikuar, at\u00ebher\u00eb \u00ebsht\u00eb m\u00eb mir\u00eb t\u00eb p\u00ebrdoren biblioteka t\u00eb jashtme. Disa nga m\u00eb t\u00eb avancuarat jan\u00eb: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/gorilla\/mux\">gorilla\/mux<\/a><\/noindex> dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/go-chi\/chi\">go-chi\/chi<\/a><\/noindex>, k\u00ebto biblioteka ofrojn\u00eb mund\u00ebsi p\u00ebr t\u00eb realizuar p\u00ebrpunimin nd\u00ebrmjet\u00ebs pa ndonj\u00eb problem t\u00eb madh. Me ndihm\u00ebn e tyre, mund t\u00eb konfiguroni ruterimin wildcard dhe t\u00eb p\u00ebrfundoni nj\u00eb s\u00ebr\u00eb detyrash t\u00eb tjera. Avantazhi i tyre \u00ebsht\u00eb p\u00ebrputhshm\u00ebria me trajtuesit standard\u00eb HTTP. Si rezultat, mund t\u00eb shkruani kod t\u00eb thjesht\u00eb me mund\u00ebsi modifikimi n\u00eb t\u00eb ardhmen.<\/p>\n<p>T\u00eb punosh me framework-e t\u00eb komplikuara n\u00eb situata t\u00eb zakonshme k\u00ebrkon zgjidhje jo standarde, dhe kjo e komplikon duksh\u00ebm p\u00ebrdorimin e trajtuesve default. P\u00ebr krijimin e shumic\u00ebs d\u00ebrrmuese t\u00eb aplikacioneve, nj\u00eb kombinim i bibliotek\u00ebs p\u00ebr default dhe nj\u00eb ruter t\u00eb thjesht\u00eb \u00ebsht\u00eb mjaftuesh\u00ebm.<\/p>\n<h4>P\u00ebrpunimi i k\u00ebrkesave<\/h4>\n<p>\nP\u00ebrve\u00e7 k\u00ebsaj, na nevojitet nj\u00eb komponent q\u00eb do t\u00eb \"d\u00ebgjoj\u00eb\" lidhjet e ardhshme dhe do t\u00eb drejtoj\u00eb t\u00eb gjitha k\u00ebrkesat te trajtuesi i duhur. K\u00ebt\u00eb detyr\u00eb e zgjidh leht\u00ebsisht http.Server.<\/p>\n<p>M\u00eb posht\u00eb tregohet se serveri \u00ebsht\u00eb p\u00ebrgjegj\u00ebs p\u00ebr t\u00eb gjitha detyrat q\u00eb lidhen me p\u00ebrpunimin e lidhjeve. Kjo \u00ebsht\u00eb, p\u00ebr shembull, puna sipas protokollit TLS. P\u00ebr t\u00eb realizuar thirrjen http.ListenAndServer p\u00ebrdoret serveri standard HTTP.<\/p>\n<p>Tani le t\u00eb shqyrtojm\u00eb shembuj m\u00eb t\u00eb nd\u00ebrlikuar.<\/p>\n<h3>Shtimi i Let\u2019s Encrypt<\/h3>\n<p>\nN\u00eb parazgjedhje, aplikacioni yn\u00eb punon sipas protokollit HTTP, por \u00ebsht\u00eb e rekomanduar t\u00eb p\u00ebrdoret protokolli HTTPS. N\u00eb Go, kjo mund t\u00eb b\u00ebhet pa asnj\u00eb problem. N\u00ebse keni marr\u00eb nj\u00eb certifikat\u00eb dhe nj\u00eb \u00e7el\u00ebs privat, at\u00ebher\u00eb mjafton t\u00eb shkruani ListenAndServeTLS duke treguar skedar\u00ebt e duhur t\u00eb certifikat\u00ebs dhe \u00e7el\u00ebsit.<\/p>\n<pre><code class=\"go\">http.ListenAndServeTLS(\":443\", \"cert.pem\", \"key.pem\", nil)<\/code><\/pre>\n<p>\nGjithmon\u00eb mund t\u00eb b\u00ebhet m\u00eb mir\u00eb.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/letsencrypt.org\/\">Let\u2019s Encrypt<\/a><\/noindex> ofron certifikata falas me mund\u00ebsi p\u00ebr rinovim automatik. P\u00ebr t\u00eb shfryt\u00ebzuar sh\u00ebrbimin, nevojitet paketi <code>autocert<\/code>.<\/p>\n<p>M\u00ebnyra m\u00eb e leht\u00eb p\u00ebr ta konfigurimin \u00ebsht\u00eb t\u00eb p\u00ebrdorni metod\u00ebn autocert.NewListener n\u00eb kombinim me http.Serve. Kjo metod\u00eb lejon marrjen dhe rinovimin e certifikatave TLS, nd\u00ebrsa serveri HTTP p\u00ebrpunon k\u00ebrkesat:<\/p>\n<pre><code class=\"go\">http.Serve(autocert.NewListener(\"example.com\"), nil)<\/code><\/pre>\n<p>\nN\u00ebse hapim n\u00eb shfletuesin ton\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/example.com\">example.com<\/a><\/noindex>, do t\u00eb marrim p\u00ebrgjigjen HTTPS \"Hello, world!\".<\/p>\n<p>N\u00ebse na nevojitet nj\u00eb konfigurim m\u00eb i detajuar, \u00ebsht\u00eb mir\u00eb t\u00eb p\u00ebrdorim menaxherin autocert.Manager. Pastaj krijojm\u00eb nj\u00eb instanc\u00eb t\u00eb vetme http.Server (deri tani e kemi p\u00ebrdorur at\u00eb n\u00eb m\u00ebnyr\u00eb default) dhe shtojm\u00eb menaxherin n\u00eb TLSConfig t\u00eb serverit:<\/p>\n<pre><code class=\"go\">m := &amp;autocert.Manager{\nCache:      autocert.DirCache(\"golang-autocert\"),\nPrompt:     autocert.AcceptTOS,\nHostPolicy: autocert.HostWhitelist(\"example.org\", \"www.example.org\"),\n}\nserver := &amp;http.Server{\n    Addr:      \":443\",\n    TLSConfig: m.TLSConfig(),\n}\nserver.ListenAndServeTLS(\"\", \"\")<\/code><\/pre>\n<p>\nKy \u00ebsht\u00eb nj\u00eb m\u00ebnyr\u00eb e thjesht\u00eb p\u00ebr t\u00eb realizuar mb\u00ebshtetje t\u00eb plot\u00eb HTTPS me rinovim automatik t\u00eb certifikateve.<\/p>\n<h3>Shtimi i rrugeve t\u00eb pap\u00ebrshtatshme<\/h3>\n<p>\nRouteri default, i p\u00ebrfshir\u00eb n\u00eb bibliotek\u00ebn standarde, \u00ebsht\u00eb i mir\u00eb, por shum\u00eb i thjesht\u00eb. N\u00eb shumic\u00ebn e aplikacioneve, nevojitet nj\u00eb rrug\u00ebzim m\u00eb kompleks, duke p\u00ebrfshir\u00eb rruge t\u00eb thella dhe wildcard ose procedura p\u00ebr vendosjen e modeleve dhe parametrave t\u00eb rrug\u00ebve.<\/p>\n<p>N\u00eb k\u00ebt\u00eb rast, \u00ebsht\u00eb mir\u00eb t\u00eb p\u00ebrdoren paketa <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/gorilla\/mux\">gorilla\/mux<\/a><\/noindex> dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/go-chi\/chi\">go-chi\/chi<\/a><\/noindex>. M\u00eb e fundit do t\u00eb m\u00ebsojm\u00eb t\u00eb punojm\u00eb \u2014 m\u00eb posht\u00eb \u00ebsht\u00eb nj\u00eb shembull.<\/p>\n<p>\u00cbsht\u00eb e dh\u00ebn\u00eb \u2014 skedari api\/v1\/api.go, i cili p\u00ebrmban rrug\u00ebt p\u00ebr API-n\u00eb ton\u00eb:<\/p>\n<pre><code class=\"go\">\/ HelloResponse is the JSON representation for a customized message\ntype HelloResponse struct {\nMessage string `json:\"message\"`\n}\n \n\/\/ HelloName returns a personalized JSON message\nfunc HelloName(w http.ResponseWriter, r *http.Request) {\nname := chi.URLParam(r, \"name\")\nresponse := HelloResponse{\nMessage: fmt.Sprintf(\"Hello %s!\", name),\n}\njsonResponse(w, response, http.StatusOK)\n}\n \n\/\/ NewRouter returns an HTTP handler that implements the routes for the API\nfunc NewRouter() http.Handler {\nr := chi.NewRouter()\nr.Get(\"\/{name}\", HelloName)\nreturn r\n}<\/code><\/pre>\n<p>\nVendosim nj\u00eb prefiks p\u00ebr rrug\u00ebt api\/vq n\u00eb skedarin kryesor.<\/p>\n<p>Ne mund ta ngrem\u00eb k\u00ebt\u00eb n\u00eb routerin ton\u00eb kryesor n\u00ebn prefiksin api\/v1 n\u00eb aplikacionin ton\u00eb kryesor:<\/p>\n<pre><code class=\"go\">\/\/ NewRouter returns a new HTTP handler that implements the main server routes\nfunc NewRouter() http.Handler {\nrouter := chi.NewRouter()\n    router.Mount(\"\/api\/v1\/\", v1.NewRouter())\n    return router\n}\nhttp.Serve(autocert.NewListener(\"example.com\"), NewRouter())<\/code><\/pre>\n<p>\nThjesht\u00ebsia e pun\u00ebs me rrug\u00ebt komplekse n\u00eb Go e b\u00ebn t\u00eb mundur thjeshtimin e strukturimit t\u00eb menaxhimit t\u00eb aplikacioneve t\u00eb m\u00ebdha dhe komplekse.<\/p>\n<h3>Puna me middleware<\/h3>\n<p>\nN\u00eb rastin e p\u00ebrpunimit t\u00eb nd\u00ebrmjet\u00ebm, p\u00ebrdoret mb\u00ebshtjellja e nj\u00eb kujdestari HTTP me nj\u00eb tjet\u00ebr, e cila e b\u00ebn t\u00eb mundur t\u00eb kryhen shpejt autentifikimi, kompresimi, regjistrimi dhe disa funksione t\u00eb tjera.<\/p>\n<p>Si nj\u00eb shembull, le t\u00eb shqyrtojm\u00eb interfac\u00ebn http.Handler, me t\u00eb cil\u00ebn do t\u00eb shkruajm\u00eb nj\u00eb kujdestar me autentifikimin e p\u00ebrdoruesve t\u00eb sh\u00ebrbimit.<\/p>\n<pre><code class=\"go\">func RequireAuthentication(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        if !isAuthenticated(r) {\n            http.Redirect(w, r, \"\/login\", http.StatusTemporaryRedirect)\n            return\n        }\n        \/\/ Duke supozuar se autentifikimi kaloi, ekzekutoni kujdestarin origjinal\n        next.ServeHTTP(w, r)\n    })\n}<\/code><\/pre>\n<p>\nEkzistojn\u00eb router\u00eb t\u00eb pal\u00ebs s\u00eb tret\u00eb, p\u00ebr shembull, chi, t\u00eb cil\u00ebt lejojn\u00eb zgjerimin e funksionalitetit t\u00eb p\u00ebrpunimit t\u00eb nd\u00ebrmjet\u00ebm.<\/p>\n<h3>Puna me skedar\u00ebt statik\u00eb<\/h3>\n<p>\nBiblioteka standarde e Go p\u00ebrfshin mund\u00ebsi p\u00ebr t\u00eb punuar me p\u00ebrmbajtje statike, duke p\u00ebrfshir\u00eb imazhe, si dhe skedar\u00eb JavaScript dhe CSS. N\u00eb to mund t\u00eb qaseni p\u00ebrmes funksionit http.FileServer. Ai kthen nj\u00eb p\u00ebrfaq\u00ebsues q\u00eb shp\u00ebrndan skedar\u00ebt nga nj\u00eb directory t\u00eb caktuar.<\/p>\n<pre><code class=\"go\">func NewRouter() http.Handler {\n    router := chi.NewRouter()\n    r.Get(\"\/{name}\", HelloName)\n \n\/\/ Konfigurimi i shp\u00ebrndarjes s\u00eb skedar\u00ebve statik\u00eb\nstaticPath, _ := filepath.Abs(\"..\/..\/static\/\")\nfs := http.FileServer(http.Dir(staticPath))\n    router.Handle(\"\/*\", fs)\n    \n    return r<\/code><\/pre>\n<p>\nEsht\u00eb e domosdoshme t\u00eb kujtohet se http.Dir e ekspozon p\u00ebrmbajtjen e katalogut n\u00eb rast se nuk ka skedarin kryesor index.html. N\u00eb k\u00ebt\u00eb rast, p\u00ebr t\u00eb parandaluar komprometimin e katalogut, \u00ebsht\u00eb mir\u00eb t\u00eb p\u00ebrdorni paket\u00ebn <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/jordan-wright\/unindexed\"><code>pa indekse<\/code><\/a><\/noindex>.<\/p>\n<h3>P\u00ebrfundim korrekt<\/h3>\n<p>\nN\u00eb Go ekziston gjithashtu funksioni p\u00ebr p\u00ebrfundimin e duhur t\u00eb serverit HTTP. Kjo mund t\u00eb b\u00ebhet p\u00ebrmes metod\u00ebs Shutdown(). Serveri niset n\u00eb nj\u00eb gorutin\u00eb, dhe m\u00eb pas nj\u00eb kanal monitorohet p\u00ebr t\u00eb pranuar sinjalin e nd\u00ebrprerjes. Sapo merr sinjalin, serveri \u00e7aktivizohet, por jo menj\u00ebher\u00eb, p\u00ebr disa sekonda.<\/p>\n<pre><code class=\"go\">handler := server.NewRouter()\nsrv := &amp;http.Server{\n    Handler: handler,\n}\n \ngo func() {\nsrv.Serve(autocert.NewListener(domains...))\n}()\n \n\/\/ Pristep p\u00ebr nj\u00eb nd\u00ebrprerje\nc := make(chan os.Signal, 1)\nsignal.Notify(c, os.Interrupt)\n&lt;-c\n \n\/\/ P\u00ebrpiquni nj\u00eb shuarje t\u00eb qet\u00eb\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\ndefer cancel()\nsrv.Shutdown(ctx)<\/code><\/pre>\n<p><\/p>\n<h3>Si p\u00ebrfundim<\/h3>\n<p>\nGo \u00ebsht\u00eb nj\u00eb gjuh\u00eb e fuqishme me nj\u00eb bibliotek\u00eb standarde praktikisht universale. Ajo ofron mund\u00ebsi t\u00eb p\u00ebrkryer, dhe k\u00ebto mund t\u00eb theksohen edhe m\u00eb shum\u00eb p\u00ebrmes nd\u00ebrfaqeve \u2014 kjo lejon zhvillimin e server\u00ebve HTTP me t\u00eb v\u00ebrtet\u00eb t\u00eb besuesh\u00ebm.<\/p>\n<blockquote><p><b>Skillbox rekomandon:<\/b><\/p>\n<ul>\n<li>Kurs praktik dyvje\u00e7ar <noindex><a rel=\"nofollow\" href=\"https:\/\/iamwebdev.skillbox.ru\/\">\u00abUn\u00eb jam zhvillues web PRO\u00bb<\/a><\/noindex>.<\/li>\n<li>Kurs online edukativ <noindex><a rel=\"nofollow\" href=\"https:\/\/skillbox.ru\/java\/\">\u00abProfesioni Java-developer\u00bb<\/a><\/noindex>.<\/li>\n<li>Kurs praktik nj\u00ebvje\u00e7ar <noindex><a rel=\"nofollow\" href=\"https:\/\/skillbox.ru\/php\/\">\u00abPHP zhvillues nga 0 n\u00eb PRO\u00bb<\/a><\/noindex>.\n<\/li>\n<\/ul>\n<\/blockquote>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/skillbox\/blog\/446454\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Gophish, \u044d\u0442\u043e \u0434\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c Golang. \u042f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e Go \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u044f\u0437\u044b\u043a, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. Go \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d: \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Go. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u0432\u0440\u043e\u0434\u0435 \u00abHello world!\u00bb, \u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":22767,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-30782","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-novosti-interneta"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Gophish, \u044d\u0442\u043e \u0434\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c Golang. \u042f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e Go \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u044f\u0437\u044b\u043a, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. Go \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d: \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Go. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u0432\u0440\u043e\u0434\u0435 \u00abHello world!\u00bb, \u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 Golang \u2014 \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Gophish, \u044d\u0442\u043e \u0434\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c Golang. \u042f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e Go \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u044f\u0437\u044b\u043a, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. Go \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d: \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Go. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u0432\u0440\u043e\u0434\u0435 \u00abHello world!\u00bb, \u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:37:25+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:37:25+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Zhvillimi i server\u00ebve web n\u00eb Golang \u2014 nga e thjeshta n\u00eb t\u00eb komplikuar | ProHoster","description":"Pes\u00eb vjet m\u00eb par\u00eb fillova t\u00eb zhvilloja Gophish, kjo m\u00eb dha mund\u00ebsin\u00eb t\u00eb studioja Golang. Kuptova se Go \u00ebsht\u00eb nj\u00eb gjuh\u00eb e fuqishme, mund\u00ebsit\u00eb e s\u00eb cil\u00ebs plot\u00ebsohen nga shum\u00eb biblioteka. Go \u00ebsht\u00eb universale: n\u00eb ve\u00e7anti, me t\u00eb \u00ebsht\u00eb e leht\u00eb t\u00eb zhvillosh aplikacione serverike. Ky artikull \u00ebsht\u00eb i dedikuar p\u00ebr t\u00eb shkruar nj\u00eb server n\u00eb Go. T\u00eb fillojm\u00eb me gj\u00ebra t\u00eb thjeshta, si \u00abHello world!\u00bb, dhe t\u00eb p\u00ebrfundojm\u00eb me nj\u00eb aplikacion me","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 Golang \u2014 \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443 | ProHoster","og:description":"\u041f\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c Gophish, \u044d\u0442\u043e \u0434\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c Golang. \u042f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e Go \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u044f\u0437\u044b\u043a, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. Go \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d: \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Go. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u0432\u0440\u043e\u0434\u0435 \u00abHello world!\u00bb, \u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441","og:url":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/razrabotka-veb-serverov-na-golang-ot-prostogo-k-slozhnomu","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:37:25+00:00","article:modified_time":"2019-10-31T18:37:25+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"30782","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 02:59:20","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:29:56","updated":"2026-01-21 02:59:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=30782"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30782\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/22767"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=30782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=30782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=30782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}