{"id":3981,"date":"2020-02-09T21:29:41","date_gmt":"2020-02-09T14:29:41","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=3981"},"modified":"2020-03-03T16:00:39","modified_gmt":"2020-03-03T09:00:39","slug":"huong-dan-tim-tat-ca-cac-clients-ket-noi-toi-cong-http-va-https","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/huong-dan-tim-tat-ca-cac-clients-ket-noi-toi-cong-http-va-https\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn t\u00ecm t\u1ea5t c\u1ea3 c\u00e1c clients k\u1ebft n\u1ed1i t\u1edbi c\u1ed5ng http v\u00e0 https"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/xEw9d0T4qmw\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>H\u01b0\u1edbng d\u1eabn t\u00ecm t\u1ea5t c\u1ea3 c\u00e1c clients k\u1ebft n\u1ed1i t\u1edbi c\u1ed5ng http v\u00e0 https.<\/p>\n<p>Trong b\u00e0i vi\u1ebft ng\u1eafn n\u00e0y, b\u1ea1n s\u1ebd h\u1ecdc c\u00e1ch t\u00ecm t\u1ea5t c\u1ea3 c\u00e1c clients (S\u1eed d\u1ee5ng IP c\u1ee7a h\u1ecd) k\u1ebft n\u1ed1i t\u1edbi Apache hay NGINX webserver tr\u00ean c\u1ed5ng HTTP v\u00e0 HTTPS .<br \/>\n\u1ede Linux, m\u1ecdi service ch\u1ea1y tr\u00ean server \u0111\u1ec1u l\u1eafng nghe socket \u0111\u1ee3i client k\u1ebft n\u1ed1i t\u1edbi. Khi m\u1ed9t k\u1ebft n\u1ed1i th\u00e0nh c\u00f4ng t\u1eeb ph\u00eda client, m\u1ed9t socket \u0111\u01b0\u1ee3c kh\u1edfi t\u1ea1o.<\/p>\n<p>\u0110\u1ec3 c\u00f3 th\u00f4ng tin v\u1ec1 c\u00e1c sockets n\u00e0y , ch\u00fang ta s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 <strong>ss <\/strong>(command-line tool), N\u00f3 \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 hi\u1ec3n th\u1ecb c\u00e1c th\u00f4ng tin v\u1ec1 m\u1ea1ng l\u01b0\u1edbi socket tr\u00ean c\u00e1c m\u00e1y ch\u1ee7 linux.\u00a0 B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng <strong>netstat\u00a0<\/strong>l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 c\u0169ng th\u00f4ng d\u1ee5ng \u0111\u1ec3 hi\u1ec3n th\u1ecb c\u00e1c k\u1ebft n\u1ed1i socket \u0111ang ho\u1ea1t \u0111\u1ed9ng.<\/p>\n<p>V\u00ed d\u1ee5, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c tool tr\u00ean \u0111\u1ec3 th\u1ed1ng k\u00ea c\u00e1c th\u00f4ng tin v\u1ec1 t\u1ea5t c\u1ea3 c\u00e1c k\u1ebft n\u1ed1i client t\u1edbi m\u1ed9t port hay m\u1ed9t d\u1ecbch v\u1ee5 c\u1ee5 th\u1ec3.<\/p>\n<pre># ss\r\nho\u1eb7c l\u00e0:\r\n# netstat<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2020\/02\/List-Network-Connections.png\" alt=\"List All Network Connections\" title=\"\"><\/p>\n<p>\u0110\u1ec3 l\u1ea5y to\u00e0n b\u1ed9 list client \u0111ang k\u1ebft n\u1ed1i t\u1edbi HTTP (port 80) v\u00e0 HTTPS (port 443), b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 <strong>ss<\/strong> ho\u1eb7c <strong>netstat<\/strong> , b\u1ea1n s\u1ebd \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea to\u00e0n b\u1ed9 k\u1ebft n\u1ed1i (bao g\u1ed3m c\u1ea3 socket unix) .<\/p>\n<pre># ss -o state established '( sport = :http or sport = :https )'\r\nHo\u1eb7c l\u00e0: \r\n# netstat -o state established '( sport = :http or sport = :https )'<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2020\/02\/List-Clients-Connected-to-HTTP-and-HTTPS-Ports.png\" alt=\"\" title=\"\"><\/p>\n<p>\u0110\u01b0\u01a1ng nhi\u00ean, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 ch\u1ea1y b\u1eb1ng c\u00e1ch ch\u1ec9 \u0111\u1ecbnh port c\u1ee5 th\u1ec3 .<\/p>\n<pre>ss -tn src :80 or src :443\r\nHo\u1eb7c\r\nnetstat -tn src :80 or src :443<\/pre>\n<p>\u0110\u1ec3 bi\u1ebft th\u00eam th\u00f4ng tin v\u1ec1 tool <strong>ss <\/strong>b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng truy v\u1ea5n sau \u0111\u1ec3 xem h\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng.<\/p>\n<pre>ss --help<\/pre>\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>H\u01b0\u1edbng d\u1eabn t\u00ecm t\u1ea5t c\u1ea3 c\u00e1c clients k\u1ebft n\u1ed1i t\u1edbi c\u1ed5ng http v\u00e0 https. Trong b\u00e0i vi\u1ebft ng\u1eafn n\u00e0y, b\u1ea1n s\u1ebd h\u1ecdc c\u00e1ch t\u00ecm t\u1ea5t c\u1ea3 c\u00e1c clients (S\u1eed d\u1ee5ng IP c\u1ee7a h\u1ecd) k\u1ebft n\u1ed1i t\u1edbi Apache hay NGINX webserver tr\u00ean c\u1ed5ng HTTP v\u00e0 HTTPS . \u1ede Linux, m\u1ecdi service ch\u1ea1y tr\u00ean server \u0111\u1ec1u l\u1eafng [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":16424,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[4801,17],"class_list":["post-3981","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-news","ht_kb_category-huong-dan-ve-cloud-vps"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/3981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=3981"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/3981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/16424"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=3981"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=3981"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=3981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}