public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Sam Michaels <sam@samtheham.org>
To: bitcoin-development@lists.sourceforge.net
Subject: [Bitcoin-development] External IP Address
Date: Sun, 16 Mar 2014 02:04:13 -0500	[thread overview]
Message-ID: <CAHLiGBPJbpeX887irHYWgWquRv8QTBBR7s4gNZ8KE9y3ZAwJnA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1211 bytes --]

Hello devs.

I was poking around in the code for a small project and I came across the
function GetMyExternalIP() in net.cpp.  The comment says you'd like to
phase out the current method.

I threw together exactly what was asked in the comments: it's a site that
has PHP echo the IP address.  Additionally, it captures the IP, user agent,
and time for analysis (a client with the same IP and user agent just
updates the entry).

The site for the client is: ip.bitcheck.us.  It does a quick search for
"Mozilla" in the user agent to redirect browers that go there.

The following information is sent:

---
GET / HTTP/1.1
Host: ip.bitcheck.us
User-Agent: /Satoshi:0.8.6/
Connection: close
---

And following is received:

---
HTTP/1.1 200 OK
Date: Sun, 16 Mar 2014 05:31:51 GMT
Server: Apache mod_fcgid/2.3.10-dev
X-Powered-By: Satoshi v1.0
X-Client-Update: yes
Content-Length: 9
Connection: close
Content-Type: text/html

127.0.0.1
---

You can look for X-Client-Update to see if the check in was logged.  Other
information can be passed in the header, too.

Errors are trapped so that it will always display the IP address and any
error information is contained in the headers.

Hope you find this useful.

Sam

[-- Attachment #2: Type: text/html, Size: 1765 bytes --]

             reply	other threads:[~2014-03-16  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-16  7:04 Sam Michaels [this message]
2014-03-16 10:22 ` [Bitcoin-development] External IP Address Wladimir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHLiGBPJbpeX887irHYWgWquRv8QTBBR7s4gNZ8KE9y3ZAwJnA@mail.gmail.com \
    --to=sam@samtheham.org \
    --cc=bitcoin-development@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox