github.com/xxf098/lite-proxy@v0.15.1-0.20230422081941-12c69f323218/config/clash_test.go (about)

     1  package config
     2  
     3  import (
     4  	"fmt"
     5  	"io/ioutil"
     6  	"testing"
     7  )
     8  
     9  func TestParseClash(t *testing.T) {
    10  	dat, err := ioutil.ReadFile("./clash.yaml")
    11  	if err != nil {
    12  		t.Error(err)
    13  	}
    14  	c, err := ParseClash(dat)
    15  	if err != nil {
    16  		t.Error(err)
    17  	}
    18  	fmt.Println(c.Proxies)
    19  }
    20  
    21  func TestShadowrocketLinkToVmessLink(t *testing.T) {
    22  	link := "vmess://YXV0bzo0MzlkYzc0Yy02ZWQ5LTQ5MDQtODVjYi0yM2JlZTY1OGQ4Y2ZAanAyLm1heWl5dW4udmlwOjgw?tfo=1&remark=80%E4%B8%A8%E8%81%94%E9%80%9A%E6%89%8B%E5%8E%85%E4%B8%A8%E6%97%A5%E6%9C%AC1Gbps%E4%B8%A81&alterId=0&obfs=websocket&path=%2F&obfsParam=shoutingtoutiao3.10010.com"
    23  	v2rayLink, err := ShadowrocketLinkToVmessLink(link)
    24  	if err != nil {
    25  		t.Fatal(err)
    26  	}
    27  	fmt.Println(v2rayLink)
    28  }