{"id":1333,"date":"2023-11-10T17:29:46","date_gmt":"2023-11-10T09:29:46","guid":{"rendered":"https:\/\/blog.humh.cn\/?p=1333"},"modified":"2023-11-10T17:32:51","modified_gmt":"2023-11-10T09:32:51","slug":"1333","status":"publish","type":"post","link":"https:\/\/blog.humh.cn\/?p=1333","title":{"rendered":"HttpServletRequest \u83b7\u53d6\u8bf7\u6c42\u76f8\u5173\u4fe1\u606f"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p>SpringBoot \u4e2d\u53ef\u4ee5\u901a\u8fc7&nbsp;HttpServletRequest \u53bb\u83b7\u53d6\u6539\u6b21\u8bf7\u6c42\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u5982\u8bf7\u6c42 url\u3001\u8bf7\u6c42\u5934\u6570\u636e\u3001\u5ba2\u6237\u7aef\u8bf7\u6c42 ip \u53ca\u7aef\u53e3\u7b49\u3002<br>\uff08javax.servlet.http.HttpServletRequest\uff09<\/p><\/blockquote>\n\n\n\n<p>\u4f8b\uff1a<strong>218.93.204.35<\/strong>&nbsp;\u901a\u8fc7&nbsp;<strong>62251<\/strong>&nbsp;\u7aef\u53e3\u53d1\u8d77\u8bf7\u6c42&nbsp;<a href=\"http:\/\/humh.cn:9080\/community_data_event\/cv\/h5\/tracking\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/humh.cn:9080\/community_data_event\/cv\/h5\/tracking<\/a>&nbsp;\uff0c\u8fd9\u4e2a\u8bf7\u6c42\u4f1a\u6307\u5411 k8s \u96c6\u7fa4\u5185\u7684 community-data-event \u8fd9\u4e2a pod\u3002<\/p>\n\n\n\n<p>\u8be5 pod \u5185\u90e8 ip \u4e3a&nbsp;<strong>10.244.4.177<\/strong>\uff0cjava \u670d\u52a1\u5185\u90e8\u542f\u52a8\u7aef\u53e3\u53f7&nbsp;<strong>8090<\/strong>\u3002\u90e8\u5206\u65e5\u5fd7\u53ca\u76f8\u5173\u4fe1\u606f\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2023-11-10 14:42:00.657|INFO|nio-8090-exec-4|c.c.w.c.w.i.RequestLogInterceptor|doLog|44|from_service=app,client_ip=<meta charset=\"utf-8\">218.93.204.35,romote_ip=<meta charset=\"utf-8\">218.93.204.35,net_state=wifi| request:{url=\/community_data_event\/cv\/h5\/tracking, params={}}\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"209\" class=\"wp-image-1335 lazyload\" title=\"HttpServletRequest \u83b7\u53d6\u8bf7\u6c42\u76f8\u5173\u4fe1\u606f\" src=\"data:image\/gif;base64,R0lGODlhAgABAIAAALGxsQAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==\" data-src=\"https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2023\/11\/20231110171832599-1024x209.png\" alt=\"https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2023\/11\/20231110171832599-1024x209.png\" data-srcset=\"https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2023\/11\/20231110171832599-1024x209.png 1024w, https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2023\/11\/20231110171832599-300x61.png 300w, https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2023\/11\/20231110171832599-768x157.png 768w, https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2023\/11\/20231110171832599.png 1078w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"><\/figure>\n\n\n\n<p><strong>\u7279\u522b\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<p>\u6b64\u6b21\u8bf7\u6c42\u5176\u5b9e\u539f\u672c\u662f&nbsp;<strong><meta charset=\"utf-8\"><strong>218.93.204.35<\/strong><\/strong>&nbsp;\u901a\u8fc7&nbsp;<strong>62251<\/strong>&nbsp;\u7aef\u53e3\u53d1\u8d77\u8bf7\u6c42&nbsp;<a href=\"http:\/\/humh.cn\/webapi\/h5\/tracking\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/humh.cn\/webapi\/h5\/tracking<\/a>&nbsp;\uff0c<a href=\"http:\/\/humh.cn\/\" target=\"_blank\" rel=\"noreferrer noopener\">humh.cn<\/a>&nbsp;\u4f1a\u6307\u5411\u5230 apisix\uff0c9080 \u4e3a apisix \u7f51\u5173\u9ed8\u8ba4\u7aef\u53e3\u3002\u800c apisix \u4e0a\u9884\u914d\u7f6e\u4e86\u89c4\u5219 \/webapi\/h5\/tracking \u8fd9\u4e2a\u8def\u5f84\u4f1a\u9759\u6001\u6539\u5199\u5230 \/community_data_event\/cv\/h5\/tracking \uff0c\u6539\u5199\u540e\u8def\u5f84\u4f1a\u8def\u7531\u5230 community-data-event \u8fd9\u4e2a pod\u3002\u800c\u9759\u6001\u6539\u5199\u5c5e\u4e8e apisix \u5185\u90e8\u5b8c\u6210\u903b\u8f91\uff0c\u6b64\u65f6\u8bf7\u6c42\u8fd8\u672a\u5230\u670d\u52a1\u5668\uff0c\u6240\u4ee5\u771f\u6b63\u53d1\u5f80\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u662f&nbsp;<a href=\"http:\/\/humh.cn:9080\/community_data_event\/cv\/h5\/tracking\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/humh.cn:9080\/community_data_event\/cv\/h5\/tracking<\/a>\uff0c\u800c\u4e0d\u662f\u6700\u5f00\u59cb\u7684&nbsp;&nbsp;<a href=\"http:\/\/humh.cn\/webapi\/h5\/tracking\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/humh.cn\/webapi\/h5\/tracking<\/a>&nbsp;\u3002<\/p>\n\n\n\n<h3>\u57fa\u4e8e\u4e0a\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u4e0b\u9762\u662f\u90e8\u5206\u65b9\u6cd5\u91ca\u4e49(community-data-event \u6b64 java pod \u5185\u8c03\u7528)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">\u65b9\u6cd5\u540d<\/th><th scope=\"col\">\u4f5c\u7528<\/th><th scope=\"col\">\u793a\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>getScheme<\/td><td>\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u534f\u8bae\u540d\uff0c\u5982 http\u3001https<\/td><td>http<\/td><\/tr><tr><td>getServerName<\/td><td>\u83b7\u53d6\u5f53\u524d\u670d\u52a1\u5668\u4e3b\u673a\u540d\uff0c\u5982\u5f53\u524d\u670d\u52a1\u57df\u540d<\/td><td><a href=\"http:\/\/humh.cn\/\" target=\"_blank\" rel=\"noreferrer noopener\">humh.cn<\/a><\/td><\/tr><tr><td>getServerPort<\/td><td>\u83b7\u53d6\u5f53\u524d\u670d\u52a1\u5668\u7aef\u53e3\u53f7\uff0c\u5982\u5f53\u524d\u670d\u52a1\u7aef\u53e3<\/td><td>9080<\/td><\/tr><tr><td>getServletPath<\/td><td>\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42 URL \u4e2d\u5bf9\u5e94 servlet \u90e8\u5206\uff0c\u5373 controller \u4e0a&nbsp;@RequestMapping \u4e2d path<\/td><td>\/community_data_event\/cv\/h5\/tracking<\/td><\/tr><tr><td>getRequestURI<\/td><td>\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42 URL \u4e2d\u201c\u534f\u8bae\u540d:\/\/\u57df\u540d\u201d\u540e\u7684\u5b50\u4e32\u90e8\u5206<\/td><td>\/community_data_event\/cv\/h5\/tracking<\/td><\/tr><tr><td>getLocalName<\/td><td>\u83b7\u53d6\u5f53\u524d\u670d\u52a1\u5185\u90e8\u4e3b\u673a\u540d<\/td><td>localhost<\/td><\/tr><tr><td>getLocalAddr<\/td><td>\u83b7\u53d6\u5f53\u524d\u670d\u52a1\u5185\u90e8 ip \u5730\u5740<\/td><td>10.244.4.177<\/td><\/tr><tr><td>getLocalPort<\/td><td>\u83b7\u53d6\u5f53\u524d\u670d\u52a1\u5185\u90e8\u7aef\u53e3\u53f7<\/td><td>8090<\/td><\/tr><tr><td>getRemoteHost<\/td><td>\u83b7\u53d6\u53d1\u8d77\u8bf7\u6c42\u7684\u8fdc\u7aef\u4e3b\u673a ip\uff0c\u5373\u53d1\u8d77\u8bf7\u6c42\u7684\u5ba2\u6237\u7aef ip<\/td><td><meta charset=\"utf-8\">218.93.204.35<\/td><\/tr><tr><td>getRemotePort<\/td><td>\u83b7\u53d6\u53d1\u8d77\u8bf7\u6c42\u7684\u8fdc\u7aef\u4e3b\u673a\u7aef\u53e3\u53f7\uff0c\u5373\u53d1\u8d77\u8bf7\u6c42\u7684\u5ba2\u6237\u7aef\u7aef\u53e3\u53f7<\/td><td>62251<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>SpringBoot \u4e2d\u53ef\u4ee5\u901a\u8fc7&nbsp;HttpServletRequest \u53bb\u83b7\u53d6\u6539\u6b21\u8bf7\u6c42\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u5982 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[51],"tags":[35,83],"_links":{"self":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts\/1333"}],"collection":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1333"}],"version-history":[{"count":2,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts\/1333\/revisions"}],"predecessor-version":[{"id":1337,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts\/1333\/revisions\/1337"}],"wp:attachment":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}