Code Monkey home page Code Monkey logo

Comments (8)

ravsii avatar ravsii commented on August 16, 2024 1

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.

@pouriyajamshidi

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on August 16, 2024 1

We should show the result in the summary output only; number 3 in your image. Under retried to resolve hostname: x times

from tcping.

ravsii avatar ravsii commented on August 16, 2024 1

ngl it looks a bit too long with ipv6 addresses
image

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 it should 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.

image

(don't mind the amount of IPs in host, facebook is just banned in my country)

from tcping.

pouriyajamshidi avatar pouriyajamshidi commented on August 16, 2024 1

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.

ravsii avatar ravsii commented on August 16, 2024 1

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 or vk 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)

image
image

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.

pouriyajamshidi avatar pouriyajamshidi commented on August 16, 2024 1

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.

pouriyajamshidi avatar pouriyajamshidi commented on August 16, 2024

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:

image

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.

ravsii avatar ravsii commented on August 16, 2024

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?

image

from tcping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.