Giter Site home page Giter Site logo

xiaoyeshiyu / litespeedtest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xxf098/litespeedtest

0.0 0.0 0.0 2.75 MB

A simple tool for batch test ss/ssr/v2ray/trojan servers.

License: GNU General Public License v3.0

Shell 0.09% JavaScript 3.76% Python 0.69% Go 75.41% CSS 0.78% Makefile 0.67% HTML 7.43% Vue 10.98% Dockerfile 0.18%

litespeedtest's Introduction

LiteSpeedTest

LiteSpeedTest is a simple tool for batch test ss/ssr/v2ray/trojan/clash servers.
Feature

  • 支持ss/ssr/v2ray/trojan/clash订阅链接
  • 支持ss/ssr/v2ray/trojan/clash节点链接
  • 支持ss/ssr/v2ray/trojan/clash订阅或节点文件
  • support ss/ssr/v2ray/trojan/clash subscription url,
  • support ss/ssr/v2ray/trojan/clash profile links
  • support ss/ssr/v2ray/trojan/clash subscription or profile file,

build

Usage

Run as a speed test tool:
    # run this command then open http://127.0.0.1:10888/ in your browser to start speed test
    ./lite
    # start with another port
    ./lite -p 10889
    
    # test in command line only mode
    ./lite --test https://raw.githubusercontent.com/freefq/free/master/v2
    # test in command line only mode with custom config.
    ./lite --config config.json --test https://raw.githubusercontent.com/freefq/free/master/v2
    # details can find here https://github.com/xxf098/LiteSpeedTest/blob/master/config.json
    # all config options:
    #       "group":"job",   // group name
	#       "speedtestMode":"pingonly", // speedonly pingonly all
	#       "pingMethod":"googleping",  // googleping tcpping
	#       "sortMethod":"rspeed",      // speed rspeed ping rping
	#       "concurrency":1,  // concurrency number
	#       "testMode":2,   // 2: ALLTEST 3: RETEST
	#       "subscription":"subscription url",
	#       "timeout":16,  // timeout in seconds
	#       "language":"en", // en cn
	#       "fontSize":24,
	#       "unique": true,  // remove duplicated value
	#       "theme":"rainbow", 
	#       "outputMode": 1  // 0: base64 1: pic path 2: no pic 3: json 4: txt


Run as a grpc server:
    # start the grpc server  
    ./lite -grpc -p 10999
    # grpc go client example in ./api/rpc/liteclient/client.go 
    # grpc python client example in ./api/rpc/liteclientpy/client.py

Run as a http/socks5 proxy:
    # use default port 8090
    ./lite vmess://aHR0cHM6Ly9naXRodWIuY29tL3h4ZjA5OC9MaXRlU3BlZWRUZXN0
    ./lite ssr://aHR0cHM6Ly9naXRodWIuY29tL3h4ZjA5OC9MaXRlU3BlZWRUZXN0
    # use another port
    ./lite -p 8091 vmess://aHR0cHM6Ly9naXRodWIuY29tL3h4ZjA5OC9MaXRlU3BlZWRUZXN0

Build

    # require go>=1.18.1, nodejs >= 14
    # build frontend
    cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./web/gui/wasm_exec.js
    npm install --prefix web/gui build
    npm run --prefix web/gui build
    GOOS=js GOARCH=wasm go get -u ./...
    GOOS=js GOARCH=wasm go build -o ./web/gui/dist/main.wasm ./wasm
    go build -o lite

Docker

 docker build --network=host  -t lite:$(git describe --tags --abbrev=0) -f ./docker/Dockerfile ./
 docker run -p 10888:10888/tcp lite:$(git describe --tags --abbrev=0)

Credits

Developer

import (
    "context"
    "fmt"
	"time"
    "github.com/xxf098/lite-proxy/web"
)
// see more details in ./examples
func testPing() error {
    ctx := context.Background()
    link := "https://www.example.com/subscription/link"
    opts := web.ProfileTestOptions{
		GroupName:     "Default", 
		SpeedTestMode: "pingonly",   //  pingonly speedonly all
		PingMethod:    "googleping", // googleping
		SortMethod:    "rspeed", // speed rspeed ping rping
		Concurrency:   2,
		TestMode:      2,
		Subscription:  link,
		Language:      "en",  // en cn
		FontSize:      24,
		Theme:         "rainbow",
        Unique:        true,
		Timeout:       10 * time.Second,
		OutputMode:  0,
	}
    nodes, err := web.TestContext(ctx, opts, &web.EmptyMessageWriter{})
    if err != nil {
        return err
    }
    // get all ok profile
    for _, node := range nodes {
        if node.IsOk {
			fmt.Println(node.Remarks)
		}
	}
    return nil
}

litespeedtest's People

Contributors

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