分类 默认分类 下的文章

关于 ip tunnel 端口转发

The AllowTcpForwarding option in the OpenSSH server configuration file must be enabled on the server to allow port forwarding. By default, forwarding is allowed.

local forwarding:
$ ssh -L 80:intra.example.com:80 gw.example.com
$ ssh -L 127.0.0.1:80:intra.example.com:80 gw.example.com

remote forwarding:
$ ssh -R 8080:localhost:80 public.example.com
$ ssh -R 52.194.1.73:8080:localhost:80 host147.aws.example.com
$ ssh -R 2222:d76767.nyc.example.com:22 -R 5432:postgres3.nyc.example.com:5432 aws4.mydomain.net

https://www.ssh.com/ssh/tunneling/example
https://www.ssh.com/ssh/tunneling/
https://stackoverflow.com/questions/3653788/how-can-i-connect-to-oracle-database-11g-server-through-ssh-tunnel-chain-double

https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/

about httpclient timeout

http://www.baeldung.com/httpclient-timeout
https://stackoverflow.com/questions/31611861/why-setconnectionrequesttimeout-doesnt-stop-my-1-min-get-request
Oracle Java parameters
https://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html

getConnectionRequestTimeout()
Returns the timeout in milliseconds used when requesting a connection from the connection manager.

getConnectTimeout()
Determines the timeout in milliseconds until a connection is established.

getSocketTimeout()
Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).

**sun.net.client.defaultConnectTimeout (default: -1)
sun.net.client.defaultReadTimeout (default: -1)**
These properties specify the default connect and read timeout (resp.) for the protocol handler used by java.net.URLConnection.
sun.net.client.defaultConnectTimeout specifies the timeout (in milliseconds) to establish the connection to the host. For example for http connections it is the timeout when establishing the connection to the http server. For ftp connection it is the timeout when establishing the connection to ftp servers.

sun.net.client.defaultReadTimeout specifies the timeout (in milliseconds) when reading from input stream when a connection is established to a resource.

about DNS cache

如何查看系统 DNScache 的 TTL (time to live). 如下,dig 命令的 hostname 之后就是 DNS server 返回的 TTL

 eric$ dig tianxiaohui.com

;; ANSWER SECTION:
tianxiaohui.com.    10    IN    A    118.184.11.30

如何查看浏览器 DNS TTL 时间:
chrome : chrome://net-internals/#dns
https://stackoverflow.com/questions/36917513/how-long-google-chrome-and-firefox-cache-dns-records

java 里面如何设置 DNS TTL:
https://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html

参考:

https://apple.stackexchange.com/questions/93949/how-long-does-the-dns-cache-last-in-mac-os-x

http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html