-
Recent Posts
Recent Comments
Categories
Links
Daily Archives: March 18, 2019
同一個port同時支援http/https
在nodejs下 httpolyglot套件可以讓server在同一個port同時支援http/https 其原理是透過偵測第一個byte 的差異來決定這條連線要走http or https TLS的一開頭 record header 第一個byte是0x16,在HTTP裡的第一個byte不會出現此數值。 參考: https://tls.ulfheim.net/ https://github.com/mscdex/httpolyglot
Posted in nodejs
Leave a comment