当前位置:网站首页>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
边栏推荐
- ZRaQnHYDAe
- ES cluster_block_exception read_only_allow_delete问题
- Calculate division in Oracle - solve the error report when the divisor is zero
- INSERT IGNORE 与INSERT INTO的区别
- Parameter index out of range (0 < 1) (1> number of parameters, which is 0
- Systemctl PHP configuration file
- Which of the top ten securities companies has the lowest commission fee and is the most safe and reliable?
- SQL query statement
- Typescript: use polymorphism instead of switch and other conditional statements
- GMP model
猜你喜欢
【推荐10个 让你轻松的 IDEA 插件,少些繁琐又重复的代码】
Solution to the problem of multi application routing using thinkphp6.0
Children play games (greed, prefix and) - Niuke winter vacation training camp
Liujinhai, chief architect of zhongang Mining: according to the analysis of fluorite supply and demand, it is estimated that the fluorine coating market has great potential
Request&Response
Cache usage
A bold sounding and awesome operation - remake a Netflix
QTreeWidget And QTableWidget
QTreeWidget And QTableWidget
ZRaQnHYDAe
随机推荐
Solution to the permission problem when NPM install -g serve reports an error
SQL
Ppbpi-h-cr, ppbpimn Cr, ppbpi Fe Cr alkynyl crosslinked porphyrin based polyimide material Qiyue porphyrin reagent
Redis系列——5种常见数据类型day1-3
Cloud native integration data warehouse heavy release
Exit of shell internal value command
Shell input validation alphanumeric only
【推荐一款实体类转换工具 MapStruct,性能强劲,简单易上手 】
GMP模型
5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent
js模块化
一文深入底层分析Redis对象结构
Redis (5) -- Talking about compressed list
Request&Response
ZRaQnHYDAe
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
The "big grievances" in the workplace are not only physically tired, but also mentally emptied
5,10,15,20-tetraphenylporphyrin (TPP) and metal complexes fetpp/mntpp/cutpp/zntpp/nitpp/cotpp/pttpp/pdtpp/cdtpp supplied by Qiyue
SQL
Crosslinked metalloporphyrin based polyimide ppbpi-h) PPBP Mn; PBP-Fe; PPBPI-Fe-CR; Ppbpi Mn CR product - supplied by Qiyue