dev7dev / V2ray-Android

A simple Java module with sample source for implementing V2ray/Xray on Android.
37 stars 12 forks source link

No Internet Issue #7

Closed CodeWithTamim closed 7 months ago

CodeWithTamim commented 7 months ago

Hi dev7 ! Recently I tried to build a v2ray android client using your module. But I'm facing some issues. When I put v2ray json config in the edit text field and connect to the server, it works fine. But when I store the json config inside of a String and use that to connect to server then then, I face no Internet problem. Let me know if you can help me to solve this issue. I stored like this private String v2ray_config= "{\n" + " \"dns\": {\n" + " \"hosts\": {\n" + " \"domain:googleapis.cn\": \"googleapis.com\"\n" + " },\n" + " \"servers\": [\n" + " \"1.1.1.1\"\n" + " ]\n" + " },\n" + " \"inbounds\": [\n" + " {\n" + " \"listen\": \"127.0.0.1\",\n" + " \"port\": 10808,\n" + " \"protocol\": \"socks\",\n" + " \"settings\": {\n" + " \"auth\": \"noauth\",\n" + " \"udp\": true,\n" + " \"userLevel\": 8\n" + " },\n" + " \"sniffing\": {\n" + " \"destOverride\": [\n" + " \"http\",\n" + " \"tls\"\n" + " ],\n" + " \"enabled\": true\n" + " },\n" + " \"tag\": \"socks\"\n" + " },\n" + " {\n" + " \"listen\": \"127.0.0.1\",\n" + " \"port\": 10809,\n" + " \"protocol\": \"http\",\n" + " \"settings\": {\n" + " \"userLevel\": 8\n" + " },\n" + " \"tag\": \"http\"\n" + " }\n" + " ],\n" + " \"log\": {\n" + " \"loglevel\": \"warning\"\n" + " },\n" + " \"outbounds\": [\n" + " {\n" + " \"mux\": {\n" + " \"concurrency\": 8,\n" + " \"enabled\": false\n" + " },\n" + " \"protocol\": \"vmess\",\n" + " \"settings\": {\n" + " \"vnext\": [\n" + " {\n" + " \"address\": \"sg2ray.serverip.my.id\",\n" + " \"port\": 443,\n" + " \"users\": [\n" + " {\n" + " \"alterId\": 0,\n" + " \"encryption\": \"\",\n" + " \"flow\": \"\",\n" + " \"id\": \"7b9ee908-93d3-49fe-bb8c-0d7f5c266d6b\",\n" + " \"level\": 8,\n" + " \"security\": \"auto\"\n" + " }\n" + " ]\n" + " }\n" + " ]\n" + " },\n" + " \"streamSettings\": {\n" + " \"network\": \"ws\",\n" + " \"security\": \"tls\",\n" + " \"tlsSettings\": {\n" + " \"allowInsecure\": false,\n" + " \"fingerprint\": \"\",\n" + " \"serverName\": \"sg2ray.serverip.my.id\",\n" + " \"show\": false\n" + " },\n" + " \"wsSettings\": {\n" + " \"headers\": {\n" + " \"Host\": \"sg2ray.serverip.my.id\"\n" + " },\n" + " \"path\": \"/serverssh.net\"\n" + " }\n" + " },\n" + " \"tag\": \"proxy\"\n" + " },\n" + " {\n" + " \"protocol\": \"freedom\",\n" + " \"settings\": {},\n" + " \"tag\": \"direct\"\n" + " },\n" + " {\n" + " \"protocol\": \"blackhole\",\n" + " \"settings\": {\n" + " \"response\": {\n" + " \"type\": \"http\"\n" + " }\n" + " },\n" + " \"tag\": \"block\"\n" + " }\n" + " ],\n" + " \"routing\": {\n" + " \"domainStrategy\": \"IPIfNonMatch\",\n" + " \"rules\": [\n" + " {\n" + " \"ip\": [\n" + " \"1.1.1.1\"\n" + " ],\n" + " \"outboundTag\": \"proxy\",\n" + " \"port\": \"53\",\n" + " \"type\": \"field\"\n" + " }\n" + " ]\n" + " }\n" + "}"; I tried to make it work using this method but it didn't work :(. Please help me to solve this. Thanks !!!