mirror of https://git.envs.net/envs/ifconfig.git
(+)add project files
This commit is contained in:
parent
0f0349ee14
commit
8797f2a330
|
@ -0,0 +1,3 @@
|
|||
appname = ifconfig
|
||||
httpport = 8080
|
||||
runmode = pro
|
|
@ -0,0 +1,249 @@
|
|||
package controllers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/astaxie/beego"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type MainController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
func (this *MainController) GetForwarded() {
|
||||
if len(this.Ctx.Request.Header["X-Forwarded-For"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["X-Forwarded-For"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetHost() {
|
||||
this.Data["Value"] = this.Ctx.Request.Host
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetIP() {
|
||||
this.Data["Value"] = this.Ctx.Input.IP()
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetPort() {
|
||||
remote_addr := []byte(this.Ctx.Request.RemoteAddr)
|
||||
pos := bytes.IndexByte(remote_addr, ':')
|
||||
this.Data["Value"] = string(remote_addr[pos+1:])
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetVia() {
|
||||
if len(this.Ctx.Request.Header["Via"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["Via"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetMime() {
|
||||
if len(this.Ctx.Request.Header["Accept"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["Accept"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetLang() {
|
||||
if len(this.Ctx.Request.Header["Accept-Language"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["Accept-Language"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetCharset() {
|
||||
if len(this.Ctx.Request.Header["Charset"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["Charset"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetEncoding() {
|
||||
if len(this.Ctx.Request.Header["Accept-Encoding"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["Accept-Encoding"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetUserAgent() {
|
||||
this.Data["Value"] = this.Ctx.Request.UserAgent()
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetConnection() {
|
||||
if len(this.Ctx.Request.Header["Connection"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["Connection"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetKeepAlive() {
|
||||
if len(this.Ctx.Request.Header["KeepAlive"]) > 0 {
|
||||
this.Data["Value"] = this.Ctx.Request.Header["KeepAlive"][0]
|
||||
}
|
||||
this.TplNames = "value.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetAll() {
|
||||
this.Data["Email"] = "missdeer@dfordsoft.com"
|
||||
this.Data["UserAgent"] = this.Ctx.Request.UserAgent()
|
||||
this.Data["Host"] = this.Ctx.Request.Host
|
||||
this.Data["IP"] = this.Ctx.Input.IP()
|
||||
remote_addr := []byte(this.Ctx.Request.RemoteAddr)
|
||||
pos := bytes.IndexByte(remote_addr, ':')
|
||||
this.Data["Port"] = string(remote_addr[pos+1:])
|
||||
this.Data["Method"] = this.Ctx.Request.Method
|
||||
if len(this.Ctx.Request.Header["Accept-Encoding"]) > 0 {
|
||||
this.Data["Encoding"] = this.Ctx.Request.Header["Accept-Encoding"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept"]) > 0 {
|
||||
this.Data["Mime"] = this.Ctx.Request.Header["Accept"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Connection"]) > 0 {
|
||||
this.Data["Connection"] = this.Ctx.Request.Header["Connection"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Via"]) > 0 {
|
||||
this.Data["Via"] = this.Ctx.Request.Header["Via"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Charset"]) > 0 {
|
||||
this.Data["Charset"] = this.Ctx.Request.Header["Charset"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["KeepAlive"]) > 0 {
|
||||
this.Data["Keepalive"] = this.Ctx.Request.Header["KeepAlive"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["X-Forwarded-For"]) > 0 {
|
||||
this.Data["Forwarded"] = this.Ctx.Request.Header["X-Forwarded-For"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept-Language"]) > 0 {
|
||||
this.Data["Lang"] = this.Ctx.Request.Header["Accept-Language"][0]
|
||||
}
|
||||
this.Data["Referer"] = this.Ctx.Input.Refer()
|
||||
|
||||
this.TplNames = "all.tpl"
|
||||
}
|
||||
|
||||
func (this *MainController) GetAllXML() {
|
||||
thisData := make(map[string]interface{})
|
||||
thisData["Email"] = "missdeer@dfordsoft.com"
|
||||
thisData["UserAgent"] = this.Ctx.Request.UserAgent()
|
||||
thisData["Host"] = this.Ctx.Request.Host
|
||||
thisData["IP"] = this.Ctx.Input.IP()
|
||||
remote_addr := []byte(this.Ctx.Request.RemoteAddr)
|
||||
pos := bytes.IndexByte(remote_addr, ':')
|
||||
thisData["Port"] = string(remote_addr[pos+1:])
|
||||
thisData["Method"] = this.Ctx.Request.Method
|
||||
if len(this.Ctx.Request.Header["Accept-Encoding"]) > 0 {
|
||||
thisData["Encoding"] = this.Ctx.Request.Header["Accept-Encoding"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept"]) > 0 {
|
||||
thisData["Mime"] = this.Ctx.Request.Header["Accept"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Connection"]) > 0 {
|
||||
thisData["Connection"] = this.Ctx.Request.Header["Connection"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Via"]) > 0 {
|
||||
thisData["Via"] = this.Ctx.Request.Header["Via"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Charset"]) > 0 {
|
||||
thisData["Charset"] = this.Ctx.Request.Header["Charset"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["KeepAlive"]) > 0 {
|
||||
thisData["Keepalive"] = this.Ctx.Request.Header["KeepAlive"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["X-Forwarded-For"]) > 0 {
|
||||
thisData["Forwarded"] = this.Ctx.Request.Header["X-Forwarded-For"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept-Language"]) > 0 {
|
||||
thisData["Lang"] = this.Ctx.Request.Header["Accept-Language"][0]
|
||||
}
|
||||
thisData["Referer"] = this.Ctx.Input.Refer()
|
||||
|
||||
this.Data["xml"] = thisData
|
||||
this.ServeXml()
|
||||
}
|
||||
|
||||
func (this *MainController) GetAllJSON() {
|
||||
thisData := make(map[string]interface{})
|
||||
thisData["Email"] = "missdeer@dfordsoft.com"
|
||||
thisData["UserAgent"] = this.Ctx.Request.UserAgent()
|
||||
thisData["Host"] = this.Ctx.Request.Host
|
||||
thisData["IP"] = this.Ctx.Input.IP()
|
||||
remote_addr := []byte(this.Ctx.Request.RemoteAddr)
|
||||
pos := bytes.IndexByte(remote_addr, ':')
|
||||
thisData["Port"] = string(remote_addr[pos+1:])
|
||||
thisData["Method"] = this.Ctx.Request.Method
|
||||
if len(this.Ctx.Request.Header["Accept-Encoding"]) > 0 {
|
||||
thisData["Encoding"] = this.Ctx.Request.Header["Accept-Encoding"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept"]) > 0 {
|
||||
thisData["Mime"] = this.Ctx.Request.Header["Accept"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Connection"]) > 0 {
|
||||
thisData["Connection"] = this.Ctx.Request.Header["Connection"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Via"]) > 0 {
|
||||
thisData["Via"] = this.Ctx.Request.Header["Via"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Charset"]) > 0 {
|
||||
thisData["Charset"] = this.Ctx.Request.Header["Charset"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["KeepAlive"]) > 0 {
|
||||
thisData["Keepalive"] = this.Ctx.Request.Header["KeepAlive"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["X-Forwarded-For"]) > 0 {
|
||||
thisData["Forwarded"] = this.Ctx.Request.Header["X-Forwarded-For"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept-Language"]) > 0 {
|
||||
thisData["Lang"] = this.Ctx.Request.Header["Accept-Language"][0]
|
||||
}
|
||||
thisData["Referer"] = this.Ctx.Input.Refer()
|
||||
|
||||
this.Data["json"] = thisData
|
||||
this.ServeJson()
|
||||
}
|
||||
|
||||
func (this *MainController) Get() {
|
||||
this.Data["Email"] = "missdeer@dfordsoft.com"
|
||||
this.Data["UserAgent"] = this.Ctx.Request.UserAgent()
|
||||
this.Data["Host"] = this.Ctx.Request.Host
|
||||
this.Data["IP"] = this.Ctx.Input.IP()
|
||||
remote_addr := []byte(this.Ctx.Request.RemoteAddr)
|
||||
pos := bytes.IndexByte(remote_addr, ':')
|
||||
this.Data["Port"] = string(remote_addr[pos+1:])
|
||||
this.Data["Method"] = this.Ctx.Request.Method
|
||||
if len(this.Ctx.Request.Header["Accept-Encoding"]) > 0 {
|
||||
this.Data["Encoding"] = this.Ctx.Request.Header["Accept-Encoding"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept"]) > 0 {
|
||||
this.Data["Mime"] = this.Ctx.Request.Header["Accept"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Connection"]) > 0 {
|
||||
this.Data["Connection"] = this.Ctx.Request.Header["Connection"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Via"]) > 0 {
|
||||
this.Data["Via"] = this.Ctx.Request.Header["Via"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Charset"]) > 0 {
|
||||
this.Data["Charset"] = this.Ctx.Request.Header["Charset"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["KeepAlive"]) > 0 {
|
||||
this.Data["Keepalive"] = this.Ctx.Request.Header["KeepAlive"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["X-Forwarded-For"]) > 0 {
|
||||
this.Data["Forwarded"] = this.Ctx.Request.Header["X-Forwarded-For"][0]
|
||||
}
|
||||
if len(this.Ctx.Request.Header["Accept-Language"]) > 0 {
|
||||
this.Data["Lang"] = this.Ctx.Request.Header["Accept-Language"][0]
|
||||
}
|
||||
this.Data["Referer"] = this.Ctx.Input.Refer()
|
||||
|
||||
if strings.Contains(this.Ctx.Request.UserAgent(), "curl") {
|
||||
this.TplNames = "iponly.tpl"
|
||||
} else {
|
||||
this.TplNames = "index.tpl"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
_ "github.com/missdeer/ifconfig/routers"
|
||||
"os"
|
||||
)
|
||||
|
||||
const (
|
||||
HostVar = "VCAP_APP_HOST"
|
||||
PortVar = "VCAP_APP_PORT"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var port string
|
||||
if port = os.Getenv(PortVar); port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
beego.Run(":" + port)
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package routers
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/missdeer/ifconfig/controllers"
|
||||
)
|
||||
|
||||
func init() {
|
||||
beego.Router("/", &controllers.MainController{}, "get:Get")
|
||||
beego.Router("/ip", &controllers.MainController{}, "get:GetIP")
|
||||
beego.Router("/host", &controllers.MainController{}, "get:GetHost")
|
||||
beego.Router("/ua", &controllers.MainController{}, "get:GetUserAgent")
|
||||
beego.Router("/port", &controllers.MainController{}, "get:GetPort")
|
||||
beego.Router("/keepalive", &controllers.MainController{}, "get:GetKeepAlive")
|
||||
beego.Router("/lang", &controllers.MainController{}, "get:GetLang")
|
||||
beego.Router("/connection", &controllers.MainController{}, "get:GetConnection")
|
||||
beego.Router("/encoding", &controllers.MainController{}, "get:GetEncoding")
|
||||
beego.Router("/via", &controllers.MainController{}, "get:GetVia")
|
||||
beego.Router("/mime", &controllers.MainController{}, "get:GetMime")
|
||||
beego.Router("/charset", &controllers.MainController{}, "get:GetCharset")
|
||||
beego.Router("/forwarded", &controllers.MainController{}, "get:GetForwarded")
|
||||
beego.Router("/all", &controllers.MainController{}, "get:GetAll")
|
||||
beego.Router("/all.xml", &controllers.MainController{}, "get:GetAllXML")
|
||||
beego.Router("/all.json", &controllers.MainController{}, "get:GetAllJSON")
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package test
|
||||
|
||||
import (
|
||||
_ "github.com/missdeer/ifconfig/routers"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func init() {
|
||||
_, file, _, _ := runtime.Caller(1)
|
||||
apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
|
||||
beego.TestBeegoInit(apppath)
|
||||
}
|
||||
|
||||
// TestMain is a sample to run an endpoint test
|
||||
func TestMain(t *testing.T) {
|
||||
r, _ := http.NewRequest("GET", "/", nil)
|
||||
w := httptest.NewRecorder()
|
||||
beego.BeeApp.Handlers.ServeHTTP(w, r)
|
||||
|
||||
beego.Trace("testing", "TestMain", "Code[%d]\n%s", w.Code, w.Body.String())
|
||||
|
||||
Convey("Subject: Test Station Endpoint\n", t, func() {
|
||||
Convey("Status Code Should Be 200", func() {
|
||||
So(w.Code, ShouldEqual, 200)
|
||||
})
|
||||
Convey("The Result Should Not Be Empty", func() {
|
||||
So(w.Body.Len(), ShouldBeGreaterThan, 0)
|
||||
})
|
||||
})
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
ip_addr: {{.IP}}
|
||||
remote_host: {{.Host}}
|
||||
user_agent: {{.UserAgent}}
|
||||
port: {{.Port}}
|
||||
lang: {{.Lang}}
|
||||
connection: {{.Connection}}
|
||||
keep_alive: {{.Keepalive}}
|
||||
encoding: {{.Encoding}}
|
||||
mime: {{.Mime}}
|
||||
charset: {{.Charset}}
|
||||
via: {{.Via}}
|
||||
forwarded: {{.Forwarded}}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"connection": "{{.Connection}}",
|
||||
"ip_addr": "{{.IP}}",
|
||||
"lang": "{{.Lang}}",
|
||||
"remote_host": "{{.Host}}",
|
||||
"user_agent": "{{.UserAgent}}",
|
||||
"charset": "{{.Charset}}",
|
||||
"port": "{{.Port}}",
|
||||
"via": "{{.Via}}",
|
||||
"forwarded": "{{.Forwarded}}",
|
||||
"mime": "{{.Mime}}",
|
||||
"keep_alive": "{{.Keepalive}}",
|
||||
"encoding": "{{.Encoding}}"
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<info>
|
||||
<charset>{{.Charset}}</charset>
|
||||
<connection>{{.Connection}}</connection>
|
||||
<encoding>{{.Encoding}}</encoding>
|
||||
<forwarded>{{.Forwarded}}</forwarded>
|
||||
<ip_addr>{{.IP}}</ip_addr>
|
||||
<keep_alive>{{.Keepalive}}</keep_alive>
|
||||
<lang>{{.Lang}}</lang>
|
||||
<mime>{{.Mime}}</mime>
|
||||
<port>{{.Port}}</port>
|
||||
<remote_host>{{.Host}}</remote_host>
|
||||
<user_agent>{{.UserAgent}}</user_agent>
|
||||
<via>{{.Via}}</via>
|
||||
</info>
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang ="en">
|
||||
<head>
|
||||
<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="content-style-type" content="text/css" />
|
||||
<meta http-equiv="content-script-type" content="text/javascript" />
|
||||
<meta http-equiv="content-language" content="en" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta name="description" content="Get my IP Address" />
|
||||
<meta name="keywords" content="ip address ifconfig" />
|
||||
<meta name="author" content="{{.Author}}" />
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<link rev="made" href="mailto: {{.Email}}" />
|
||||
<title>What Is My IP Address? - Yet Another ifconfig</title>
|
||||
<style type="text/css">
|
||||
* {margin:0; padding:0;font-style:normal;font-weight:normal;font-family:Arial,sans-serif;font-size:13px;color:#333;}
|
||||
body{}
|
||||
#container{background:white;width:750px;margin:10px auto;margin-bottom:10px;border:solid 1px #888;}
|
||||
#header{height:50px;padding:15px 0 10px 10px;}
|
||||
#header table{width:100%;}
|
||||
h1 a{font-size:20px;margin:10px;letter-spacing:1px;text-decoration:none;color:#555;}
|
||||
#ads{height:20px;margin-bottom:15px;text-align:right;background:#777;padding-top:4px;border-left:solid 1px #888;border-right:solid 1px #888;}
|
||||
#info_area{float:left;margin-left:11px;}
|
||||
#info_table{border-collapse:collapse;margin:0 auto;line-height:20px;width:728px;table-layout:fixed;}
|
||||
#info_table tr{height:30px;}
|
||||
#info_table td{border: solid 1px #888;padding: 0px 10px;}
|
||||
.info_table_label{width:100px;}
|
||||
#table_ads{width:260px;text-align:center;}
|
||||
#middle{height:110px;clear:both;text-align:center;padding-top:20px;}
|
||||
#cli_wrap{margin:0 10px;}
|
||||
h2{height:30px;line-height:30px;font-size:18px;margin:0 5px;padding-left:5px;}
|
||||
#cli_table{border:solid 1px #888;border-collapse:collapse;width:728px;margin:0 auto;line-height:20px;table-layout:fixed;}
|
||||
#cli_table tr{height:30px;}
|
||||
#cli_table td{border-bottom: solid 1px #888;padding-top:3px;padding-bottom:3px;overflow:hidden;}
|
||||
.cli_command{width:190px;padding-left:10px;}
|
||||
.cli_arrow{width:40px;text-align:center;}
|
||||
#footer{background:#777;height:20px;line-height:20px;color:#ddd;text-align:center;margin-top:15px;border-top:none;}
|
||||
#ip_address{font-size:1.9em;}
|
||||
#ip_address_cell{padding:5px;height:50px;}
|
||||
|
||||
#plungins{height:20px;float:right;}
|
||||
.plungin{float:right;}
|
||||
#button_twitter{width:100px;}
|
||||
#button_plusone{width:70px;}
|
||||
#button_facebook{width:100px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container" class="clearfix">
|
||||
<div id="header">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<h1><a href="http://ifconfig.jd-app.com">What Is My IP Address? - Yet Another ifconfig</a></h1>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="ads">
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "ca-pub-3435940217424489";
|
||||
google_ad_slot = "9166587836";
|
||||
google_ad_width = 728;
|
||||
google_ad_height = 15;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>
|
||||
</div>
|
||||
<div id="info_area">
|
||||
<h2>Your Connection</h2>
|
||||
<table id="info_table" summary="info">
|
||||
<tr>
|
||||
<td class="info_table_label">IP Address</td>
|
||||
<td id="ip_address_cell"><strong id="ip_address">{{.IP}}</strong></td>
|
||||
<td rowspan="8" id="table_ads">
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "ca-ca-pub-3435940217424489";
|
||||
google_ad_slot = "9166587836";
|
||||
google_ad_width = 250;
|
||||
google_ad_height = 250;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="info_table_label">Remote Host</td><td>{{.Host}}</td></tr>
|
||||
<tr><td class="info_table_label">User Agent</td><td>{{.UserAgent}}</td></tr>
|
||||
<tr><td class="info_table_label">Port</td><td>{{.Port}}</td></tr>
|
||||
<tr><td class="info_table_label">Language</td><td>{{.Lang}}</td></tr>
|
||||
<tr><td class="info_table_label">Referer</td><td>{{.Referer}}</td></tr>
|
||||
<tr><td class="info_table_label">Connection</td><td>{{.Connection}}</td></tr>
|
||||
<tr><td class="info_table_label">KeepAlive</td><td>{{.Keepalive}}</td></tr>
|
||||
<tr><td class="info_table_label">Method</td><td colspan="2">{{.Method}}</td></tr>
|
||||
<tr><td class="info_table_label">Encoding</td><td colspan="2">{{.Encoding}}</td></tr>
|
||||
<tr><td class="info_table_label">MIME Type</td><td colspan="2">{{.Mime}}</td></tr>
|
||||
<tr><td class="info_table_label">Charset</td><td colspan="2">{{.Charset}}</td></tr>
|
||||
<tr><td class="info_table_label">Via</td><td colspan="2">{{.Via}}</td></tr>
|
||||
<tr><td class="info_table_label">X-Forwarded-For</td><td colspan="2">{{.Forwarded}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="middle">
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "ca-pub-3435940217424489";
|
||||
google_ad_slot = "9166587836";
|
||||
google_ad_width = 728;
|
||||
google_ad_height = 90;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>
|
||||
</div>
|
||||
<div id="cli_wrap">
|
||||
<h2>Command Line Interface</h2>
|
||||
<table id="cli_table" summary="cli">
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com</td><td class="cli_arrow">⇒</td><td>{{.IP}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/ip</td><td class="cli_arrow">⇒</td><td>{{.IP}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/host</td><td class="cli_arrow">⇒</td><td>{{.Host}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/ua</td><td class="cli_arrow">⇒</td><td>{{.UserAgent}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/port</td><td class="cli_arrow">⇒</td><td>{{.Port}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/lang</td><td class="cli_arrow">⇒</td><td>{{.Lang}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/keepalive</td><td class="cli_arrow">⇒</td><td>{{.Keepalive}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/connection</td><td class="cli_arrow">⇒</td><td>{{.Connection}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/encoding</td><td class="cli_arrow">⇒</td><td>{{.Encoding}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/mime</td><td class="cli_arrow">⇒</td><td>{{.Mime}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/charset</td><td class="cli_arrow">⇒</td><td>{{.Charset}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/via</td><td class="cli_arrow">⇒</td><td>{{.Via}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/forwarded</td><td class="cli_arrow">⇒</td><td>{{.Forwarded}}</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/all</td><td class="cli_arrow">⇒</td><td>ip_addr: {{.IP}}<br />remote_host: {{.Host}} <br />user_agent: {{.UserAgent}}<br />port: {{.Port}}<br />lang: {{.Lang}}<br />connection: {{.Connection}}<br />keep_alive: {{.Keepalive}}<br />encoding: {{.Encoding}}<br />mime: {{.Mime}}<br />charset: {{.Charset}}<br />via: {{.Via}}<br />forwarded: {{.Forwarded}}<br /></td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/all.xml</td><td class="cli_arrow">⇒</td><td><info><br /> <charset>{{.Charset}}</charset><br /> <connection>{{.Connection}}</connection><br /> <encoding>{{.Encoding}}</encoding><br /> <forwarded>{{.Forwarded}}</forwarded><br /> <ip_addr>{{.IP}}</ip_addr><br /> <keep_alive>{{.Keepalive}}</keep_alive><br /> <lang>{{.Lang}}</lang><br /> <mime>{{.Mime}}</mime><br /> <port>{{.Port}}</port><br /> <remote_host>{{.Host}}</remote_host><br /> <user_agent>{{.UserAgent}}</user_agent><br /> <via>{{.Via}}</via><br />
|
||||
</info><br />
|
||||
</td></tr>
|
||||
<tr><td class="cli_command">$ curl ifconfig.jd-app.com/all.json</td><td class="cli_arrow">⇒</td><td>{"connection":"{{.Connection}}","ip_addr":"{{.IP}}","lang":"{{.Lang}}","remote_host":"{{.Host}}","user_agent":"{{.UserAgent}}","charset":"{{.Charset}}","port":"{{.Port}}","via":"{{.Via}}","forwarded":"{{.Forwarded}}","mime":"{{.Mime}}","keep_alive":"{{.Keepalive}}","encoding":"{{.Encoding}}"}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="footer">© 2014 <a href="http://minidump.info">minidump.info</a></div>
|
||||
</div>
|
||||
<!--
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("UA-10827147-6");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}</script>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
{{.IP}}
|
|
@ -0,0 +1 @@
|
|||
{{.Value}}
|
Loading…
Reference in New Issue