Comments (8)
I'll take this one next because it seems small (you're probably tired of my 600 LOC PRs in a 1000 LOC project haha)
One question though, how I can possibly test this? I assume (don't know for sure) the usual example.com 80
wont work.
from tcping.
We should show the result in the summary
output only; number 3 in your image. Under retried to resolve hostname: x times
from tcping.
ngl it looks a bit too long with ipv6 addresses
Maybe split it into multiple strings, like
IP address was changed at 2023-23-23....
2a03:2880:f113:81:face:b00c:0:25de -> 2a03:2880:f113:81:face:b00c:0:25de
Also this is probably not working as intended, as it tried to resolve using the same ip twice (sometimes more) in a row. I dont know much about networking, so could be wrong here.
I have written
retryResolve
function to randomly pick an address and itshould avoid picking the same thing again
, ....
❯ host fb.com
fb.com has address 157.240.205.35
fb.com has IPv6 address 2a03:2880:f113:81:face:b00c:0:25de
fb.com mail is handled by 10 mxb-00082601.gslb.pphosted.com.
fb.com mail is handled by 10 mxa-00082601.gslb.pphosted.com.
(don't mind the amount of IPs in host
, facebook is just banned in my country)
from tcping.
Maybe something like:
IP address changes:
from abc to xyz at 2023-x-y 00:00:00
from xyz to abc at 2023-x-y 00:20:00
if the new and old IP addresses are the same, we do not report anything. Because nothing was changed.
hmmm, I chose FB because they had a lotta IP addresses. Not sure what websites in your country are having multiple IP addresses but usually the popular ones like yandex
or vk
should have multiple ones.
Try the host
command similar to my example and see if we get lucky?
from tcping.
Maybe something like:
IP address changes: from abc to xyz at 00:00:00 from xyz to abc at 00:20:00
Yeah, let's try
if the new and old IP addresses are the same, we do not report anything. Because nothing was changed.
Of course.
hmmm, I chose FB because they had a lotta IP addresses. Not sure what websites in your country are having multiple IP addresses but usually the popular ones like
yandex
orvk
should have multiple ones.
Yeah, could work as well, but I just used VPN, so that's not a problem.
What I meant is: it tried to resolve fb.com
and gave me the same ipv6 address twice in the row, but you said tcping shouldn't try/check the same address more than once. As I already said, I'm not sure if it's a bug or it supposed to work this way.
Because of that, this happens (resolving into the same IP twice)
I think the appropriate question is: Is it supposed to work this way and it's my job to handle this, or is it a bug and resolving into the same ip twice in a row is unintended behaviour?
from tcping.
What I meant is: it tried to resolve fb.com and gave me the same ipv6 address twice in the row, but you said tcping shouldn't try/check the same address more than once. As I already said, I'm not sure if it's a bug or it supposed to work this way.
ah, I think you only see one IPv4 and one IPv6 address for FB which is usually the case for most resolvers. It is fine.
I think the appropriate question is: Is it supposed to work this way and it's my job to handle this, or is it a bug and resolving into the same ip twice in a row is unintended behaviour?
This is not a bug from our end. No need to handle any special edge cases. The purpose of this issue is to just report actual changes if there are any.
from tcping.
I'll take this one next because it seems small (you're probably tired of my 600 LOC PRs in a 1000 LOC project haha)
haha, not really.
One question though, how I can possibly test this? I assume (don't know for sure) the usual example.com 80 wont work.
Good question! I would use Facebook's servers for this one. This is my view and should not be so different for you either:
I'll run the program like:
tcping fb.com 443 -r 2
And play with iptables
like this for each resolved IP:
sudo iptables -A OUTPUT -d 31.13.66.35 -j DROP; sleep 3; sudo iptables -F
I have written retryResolve
function to randomly pick an address and it should avoid picking the same thing again, making it easier to test this use case.
from tcping.
I'll run the program like:
tcping fb.com 443 -r 2
Thanks, good idea
Last question: In which cases there should be output? I think 2 and 3 for sure, but what about 1?
from tcping.
Related Issues (20)
- add TTL in output please HOT 3
- Please add "count" and "interval" option HOT 3
- Add tcping to winget
- output interface HOT 13
- v2.0.0 is not listed on Go module proxy due to missing /v2 suffix in the "module" path HOT 8
- fix database user input flag HOT 8
- Database closure before the appropriate time. HOT 2
- Include db.go in the Makefile HOT 10
- refactor the processUserInput function HOT 8
- reduce RTT floating point precision when storing them into the database HOT 3
- Add Prometheus exporter HOT 12
- Assess replacing current sqlite package HOT 6
- re-add the static Linux binary
- wrong downtime calculation when timeout is set to under a second
- Significant size increase HOT 4
- break build section of Makefile into smaller chunks
- add -h flag to show help HOT 1
- add time in output line please HOT 7
- On ARM devices, DNS always resolves IPV6 ::1 by default HOT 9
- Easier installation on linux: snap package HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcping.