Coder Social home page Coder Social logo

http-meta's Introduction

HTTP META

社群

👏🏻 欢迎加入社群进行交流讨论

👥 群组 折腾啥(群组)

📢 频道 折腾啥(频道)

Usage

⚠️ If a proxy is already running on the device running http-meta, you may need to exclude the http-meta process.

The Easy Way(for example, on an Android device)

Create a folder /data/http-meta

Download http-meta.bundle.js, rename it to http-meta.bundle.jsand move it to the /data/http-meta folder.

Create a folder /data/http-meta/meta

Download Meta, rename it to http-meta and move it to the /data/http-meta/meta folder.

Download tpl.yaml, rename it to tpl.yaml and move it to the /data/http-meta/meta folder.

META_FOLDER can be the absolute path of the meta folder if neccessary.

META_TEMP_FOLDER can be the absolute path of the temp folder if neccessary. Defaults to the default directory for temporary files of the operating system. This path may have to be provided in the Android environment.

META_TEMP_FOLDER=/data/http-meta META_FOLDER=/data/http-meta/meta HOST=127.0.0.1 PORT=9876 node http-meta.bundle.js

The Hard Way

cd /data

git clone https://github.com/xream/http-meta.git http-meta

cd /data/http-meta

Download Meta, rename it to http-meta and move it to the /data/http-meta/meta folder.

cd /data/http-meta

pnpm i

META_FOLDER can be the absolute path of the meta folder if neccessary.

META_TEMP_FOLDER can be the absolute path of the temp folder if neccessary. Defaults to the default directory for temporary files of the operating system. This path may have to be provided in the Android environment.

META_TEMP_FOLDER=/data/http-meta META_FOLDER=/data/http-meta/meta HOST=127.0.0.1 PORT=9876 pnpm start

Authorization

Set the AUTHORIZATION environment variable to enable authorization.

Add the Authorization header to the request.

Test

curl '127.0.0.1:9876/test'

Response

{
    "pid": 35955,
    "log":"INFO Mixed(http+socks)[listener-proxy-0] proxy listening at: [::]:65535",
    "config": "bind-address: 0.0.0.0\nallow-lan: true"
}

Start (always start a new one)

curl '127.0.0.1:9876/start' \
--header 'Content-Type: application/json' \
--data '{
    "timeout": 1800000, // process will be killed after 30 minutes(default)
    "proxies": [
        {
            "name": "1",
            "server": "1.2.3.4",
            "port": 80,
            "type": "vmess",
            ...
        }
    ]
}'

Response

{
    "ports": [
        65534,
        65533
    ],
    "pid": 61289
}

Retart(stop all and start a new one)

curl '127.0.0.1:9876/start' \
--header 'Content-Type: application/json' \
--data '{
    "timeout": 1800000, // process will be killed after 30 minutes(default)
    "proxies": [
        {
            "name": "1",
            "server": "1.2.3.4",
            "port": 80,
            "type": "vmess",
            ...
        },
          {
            "name": "2",
            "server": "1.2.3.4",
            "port": 80,
            "type": "vmess",
            ...
        }
    ]
}'

Response

{
    "ports": [
        65534,
        65533
    ],
    "pid": 61289
}

Stop

Stop All

curl --request POST '127.0.0.1:9876/stop'

Stop by PID

curl '127.0.0.1:9876/stop' \
--header 'Content-Type: application/json' \
--data '{
    "pid": [
        1,
        2
    ]
}'

Response

{
    "pid": null
}

Get Stats

curl '127.0.0.1:9876/stats' \
--header 'Content-Type: application/json'

Response

{
    "35955": {
        "pid": 35955,
        "mem": "2MB",
        "cpu": "0%"
    }
}

Get Stats by PID

curl '127.0.0.1:9876/stats' \
--header 'Content-Type: application/json' \
--data '{"pid": [35955]}'

Response

{
    "35955": {
        "pid": 35955,
        "ports": [
            65534,
            65533
        ],
        "mem": "2MB",
        "cpu": "0%"
    }
}

http-meta's People

Contributors

xream 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.