当前位置:网站首页>Go language custom DNS resolver practice yyds dry inventory
Go language custom DNS resolver practice yyds dry inventory
2022-06-26 07:31:00 【FunTester】
Finished writing Java Customize DNS Parser practice and Java Customize DNS Parser load balancing implementation after , Nature also needs to be right Go Language testing extends the same functionality , Some detours , The ultimate goal has been achieved . Share today Go Language HTTP Interface test customization DNS The implementation of parsing . Here only http Library as demo ,fasthttp Try to share again later .
Set up net.Dialer
Let's share net.Dialer How to set it up .net.Dialer Dialer , My understanding is that HTTP Connection establishment class , Be similar to Java Language HttpClient In the library org.apache.http.impl.conn.PoolingHttpClientConnectionManager Some functions .(HttpClient4.5x Recommend this in the future ).
Strange knowledge points
In the course of this study , Found out Go Linguistic net/http The library also supports another interesting feature , Binding DNS service IP, This sometimes partly solves the need to send the request for a fixed domain name to a fixed machine .
The simple setting method is as follows :
Other settings are the same as above .
Customize net.Dialer
stay http.Transport Creating parameters , There is one DialContext Parameter is specified to create unencrypted TCP Connected dial function . Parameter type is func(ctx context.Context, network, addr string) (net.Conn, error) Method , Here I used to call it closure . We just need to implement this method .
In the following example, I set two IP To test load balancing ( The next issue will be a text version and a video version ).
In the middle, there is a part through the custom nameserver Get the domain name resolution result IP The process of , Commented out , Keep it for later use .
test
The test cases are as follows :
Console output :
Test service
Test service based on moco_FunTester Simple services written in the framework , The script is as follows :
Have Fun ~ Tester !
- FunTester2021 In summary
- FunTester Original reward
- Groovy Great reward for language learning notes 【FunTester】
- getInteger still getIntValue, That's a problem
- Fix QPS Pressure test mode exploration
- How to break through the career bottleneck
- How to choose API Testing tools
- Which performance framework is better —JMeter、K6、locust、FunTester Horizontal contrast
- Groovy Medium list
- Java&Go Three HTTP Client performance test
- How to reduce the error of the machine in performance test
- establish Java The guardian thread
- Piecewise random practice — Analog online traffic
- Design draft of ten million log playback engine
边栏推荐
- The first screen time, you said you optimized it, then you calculated it and showed it to me!
- Encapsulating ranging and surface class based on leaflet
- i3wm 获取window class
- SQL
- CMDA 3634 image processing
- Pycharm settings
- 多传感器融合感知
- 一文搞懂Glide,不懂来打我
- Meso tetra (4-bromophenyl) porphyrin (tbpp); 5,10,15,20-tetra (4-methoxy-3-sulfonylphenyl) porphyrin [t (4-mop) ps4] supplied by Qiyue
- A bold sounding and awesome operation - remake a Netflix
猜你喜欢

【推荐一款实体类转换工具 MapStruct,性能强劲,简单易上手 】

C#/. Net phase VI 01C Foundation_ 02:vs2019 basic operations, excluding code files, smart tips, data types, differences between float and double, and differences between string and string
![Jemter stress test - visualization tool support - [installation]](/img/e9/9acda4e37c98cc21df9499684205c6.png)
Jemter stress test - visualization tool support - [installation]

Sanic based services use celery to complete dynamic modification timing tasks

快速找到优质对象的5种渠道,赶紧收藏少走弯路

MySQL basic usage 01
![Jemter stress test - basic requirements - [teaching]](/img/f4/36dbd80e89d96e1121a6e2b92d1d07.png)
Jemter stress test - basic requirements - [teaching]

Tetra - (4-pyridyl) porphyrin tpyp and metal complexes zntpyp/fetpyp/mntpyp/cutpyp/nitpyp/cotpyp/ptpyp/pdtpyp/cdtpyp (supplied by Qiyue porphyrin)

Redis (4) -- Talking about integer set

一文分析EventBus-事件总线的使用方法和实现原理
随机推荐
MySQL 'replace into' 的坑 自增id,备机会有问题
Redis (4) -- Talking about integer set
item2安装配置及环境失效问题解决
Cocoscreator plays spine animation
ES字符串类型(Text vs keyword)的选择
面试被问Redis主从复制不会答?这13张图让你彻底弄明白
Introduction to mapping in ES
Excel中Unicode如何转换为汉字
ZRaQnHYDAe
php array_merge详解
数据中心灾难恢复的重要参考指标:RTO和RPO
Crosslinked metalloporphyrin based polyimide ppbpi-h) PPBP Mn; PBP-Fe; PPBPI-Fe-CR; Ppbpi Mn CR product - supplied by Qiyue
13. Mismatch simulation of power synthesis for ads usage recording
Porphyrin based polyimide ppbpis (ppbpi-pa, ppbpi-pepa and ppbpi-pena); Crosslinked porphyrin based polyimide (ppbpi-pa-cr, ppbpi-pepa-cr, ppbpi-pena-cr) reagent
The long path of Xiao Sha (graph theory, Euler diagram)
GMP模型
Meso tetra (4-bromophenyl) porphyrin (tbpp); 5,10,15,20-tetra (4-methoxy-3-sulfonylphenyl) porphyrin [t (4-mop) ps4] supplied by Qiyue
Tetra - (4-pyridyl) porphyrin tpyp and metal complexes zntpyp/fetpyp/mntpyp/cutpyp/nitpyp/cotpyp/ptpyp/pdtpyp/cdtpyp (supplied by Qiyue porphyrin)
Jemter stress test - visualization tool support - [installation]
[recommend 10 easy idea plug-ins with less tedious and repetitive code]