Code Monkey home page Code Monkey logo

mod_ip's Introduction

mod_ip

Apache module to report IP address to web clients as a JSON response

Description

This module reports the IP the user came from, as a JSONP response. GET requests required; CGI style arguments are permitted.

argument description
callback=[name] to call a function name of your choosing
size=[number] to pad the http data portion of the response. (Does not attempt to offset header response)
asn=1 peform ISP ASN and name lookups
testip=IPADDRESS to override the IP address, force it to look up another

If the callback is "?", it will output to the screen (calling it "callback"), using plain text. Any other name, will output a JSON script instead, using the callback name specified.

Example:

http://test-ipv6.com/ip/?callback=hello&testip=2001:470:1:18::2&asn=1

Returns:

hello({"ip":"2001:470:1:18::2","type":"ipv6","subtype":"","via":"","asn":"6939","asn_name":"HURRICANE - Hurricane Electric, Inc.","asnlist":"6939","padding":""})

Installation

./configure
make
sudo make install   

Activation

Something like this should be in your web server config; it should have been placed there automatically with make install. The apache build system would have taken care of that for you. Some platforms, however, do not (such as ubuntu), so you'll need to double check.

LoadModule mod_ip_module      libexec/apache22/mod_ip.so

Configuration

Even on platforms were activation was automatic, configuration was not. You'll need to explicitly enable mod_ip for the paths you want it in.

  • If you're installing falling-sky, go back to the install instructions.
  • If you're installing mod_ip for another project, do something like this:
    <VirtualHost test-ipv6.com>
    ..

    # Set /ip/  to use mod_ip
    <LocationMatch ^/ip/?$>
     SetHandler mod_ip
    </locationMatch>

    # You may optionally include the output of ./scan-sixxs.pl here
    ..
    </VirtualHost>

mod_ip's People

Contributors

delan avatar jfesler avatar

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.