반응형
m.logPrint() is working!
<eq> and <eqq> tags are rendered to MathJax format, being enclosed by \ ( \ ) and \ [ \ ].
docuK-1 scripts started!
If this log is not closed automatically, there must be an error somewhere in your document or scripts.
Table of Contents is filled out.
Auto numberings of sections (div.sec>h2, div.subsec>h3, div.subsubsec>h4), <eqq> tags, and <figure> tags are done.
<cite> and <refer> tags are rendered to show bubble reference.
<codeprint> tags are printed to corresponding <pre> tags, only when the tags exist in the document.
Current styles (dark/bright mode, font-family, font-size, line-height) are shown.
disqus.js with id="disqus-js" is loaded.
kakao.js with id="kakao-jssdk" is loaded.
New ShortKeys (T: Table of Contents, F: Forward Section, D: Previous Section, L: To 전체목록/[Lists]) are set.
m.delayPad=512;
m.wait=1024;
wait 999ms.
<eq> and <eqq> tags are rendered to MathJax format, being enclosed by \ ( \ ) and \ [ \ ].
docuK-1 scripts started!
If this log is not closed automatically, there must be an error somewhere in your document or scripts.
Table of Contents is filled out.
Auto numberings of sections (div.sec>h2, div.subsec>h3, div.subsubsec>h4), <eqq> tags, and <figure> tags are done.
<cite> and <refer> tags are rendered to show bubble reference.
<codeprint> tags are printed to corresponding <pre> tags, only when the tags exist in the document.
Current styles (dark/bright mode, font-family, font-size, line-height) are shown.
disqus.js with id="disqus-js" is loaded.
kakao.js with id="kakao-jssdk" is loaded.
New ShortKeys (T: Table of Contents, F: Forward Section, D: Previous Section, L: To 전체목록/[Lists]) are set.
m.delayPad=512;
m.wait=1024;
wait 999ms.







Mode: Bright; Font: Noto Sans KR; font-size: 18.0px (10.0); line-height: 1.6;
width: 1280, height: 720, version: 2.12.18
Canonical URI: https://kipid.tistory.com/entry/Referrer-in-Server-Vert-x-and-Client-javascript
dg:plink (Document Global Permanent Link): https://kipid.tistory.com/254
document.referrer: Empty
width: 1280, height: 720, version: 2.12.18
Canonical URI: https://kipid.tistory.com/entry/Referrer-in-Server-Vert-x-and-Client-javascript
dg:plink (Document Global Permanent Link): https://kipid.tistory.com/254
document.referrer: Empty







Referer 알아내기 in Server (Vert.x) and Client (HTML/javascript)
Client (방문객) 이 어느 경로를 통해 들어왔는지, 어느 검색어를 통해 어느 검색엔진을 통해 들어왔는지 등을 알아내려면 어떻게 해야할까?
Vert.x 랑 javascript 에서 쓰이는 referer/referrer 철자 (spelling) 가 다르네? ㅡㅂㅡ;;;
Table of Contents
T1.Referer in Vert.x server
▼ Show/Hide
참고
[01]
.Ref. [01] https://vertx.io/
import io.vertx.core.AbstractVerticle; import io.vertx.core.http.HttpServerRequest; import io.vertx.ext.web.Router; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Recoeve extends AbstractVerticle { public static final String host="recoeve.net"; public static final String ENCODING="UTF-8"; public static final String INVALID_ACCESS="INVALID ACCESS"; private static long numberOfClients; static { numberOfClients=0; } @Override public void start() { Router router=Router.router(vertx); router.route().handler(ctx -> { HttpServerRequest req=ctx.request(); System.out.println("\n\nA client has connected!: "+(++numberOfClients)); final String referer=req.headers().get("Referer"); if (referer!=null) { try { System.out.println("Referer: "+URLDecoder.decode(referer, "UTF-8")); } catch (UnsupportedEncodingException e) { System.out.println(e); } } else { System.out.println("Referer: null"); } if (referer.substring(0,4).toLowerCase().equals("http")) { int k=4; if (referer.charAt(k)=='s'||referer.charAt(k)=='S') { k++; } if (referer.startsWith("://",k)) { k+=3; int l=referer.indexOf('/',k); String refererHost=null; if (l==-1) { refererHost=referer.substring(k); } else { refererHost=referer.substring(k,l); } System.out.println("Referer Host: "+refererHost); } } try { System.out.println("Absolute URI: "+URLDecoder.decode(req.absoluteURI(), "UTF-8")); } catch (UnsupportedEncodingException e) { System.out.println(e); } req.response().putHeader("Content-Type","text/plain; charset=utf-8"); req.response().end(INVALID_ACCESS, ENCODING); System.out.println(INVALID_ACCESS); }); vertx.createHttpServer() .requestHandler(router).listen(80); } // public void start() } // public class Recoeve extends AbstractVerticle
// Log Example A client has connected!: 208 Referer: https://recoeve.net/CDN/docuK-2.3.css Referer Host: recoeve.net Absolute URI: https://recoeve.net/CDN/cc.png
▲ Hide
T2.Document.referrer in HTML/Javascript
▼ Show/Hide
참고
[02]
.Ref. [02] MDN :: API - Document.referrer
document.referrer: Empty
<script> let referrer=document.referrer; let referrerHTML=(referrer?`<a target="_blank" href="${referrer}">${m.escapeHTML(decodeURIComponent(referrer))}</a>`:`Empty`); $("#pre-result").html(`document.referrer: ${referrerHTML}`); </script>
▲ Hide
TRefs.References and Related Articles
▼ Show/Hide
- Ref. [01] https://vertx.io/
- Ref. [02] MDN :: API - Document.referrer
▲ Hide







반응형
'[IT/Programming] > HTML related' 카테고리의 다른 글
imgur - Embed album (5) | 2023.11.28 |
---|---|
인터넷에서 예쁘게 코드 입력하기 (google code prettify) (1) | 2023.11.04 |
Learning AJAX (1) | 2023.11.04 |
URL | URI parser (URL 의 href, origin, protocol, host, hostname, port, pathname, search, hash 뽑아내기) (0) | 2023.11.04 |
HTML id 에 한글이나 encodeURIComponent, %, \s, [, ], !, @, #, $, %, ^, &, *, (, ), -, _, +, =, \, /, ?, ~, :, ;, ", ', <, >, ,, . 등 특수문자 (special characters) 들어갈 수 있는지 테스트 해보기 (0) | 2023.11.04 |
Spread syntax ... operator in Javascript (0) | 2023.10.30 |
Formatting the lyrics to Recoeve.net style (genius.com) (1) | 2023.10.29 |