Skip to content

Commit

Permalink
Update vless.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahid Farid committed May 31, 2024
1 parent f4f1675 commit c3aa1d7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/vless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ import { RemoteSocketWrapper, CustomArrayBuffer, VlessHeader, UDPOutbound, Confi

const WS_READY_STATE_OPEN: number = 1
const WS_READY_STATE_CLOSING: number = 2
let uuid: string = ""
let proxyIP: string = ""
let proxyList: Array<string> = []
let blockPorn: string = ""
let filterCountries: string = ""
let countries: Array<string> = []

export async function GetVlessConfigList(sni: string, addressList: Array<string>, max: number, env: Env) {
export async function GetVlessConfigList(sni: string, addressList: Array<string>, start: number, max: number, env: Env) {
filterCountries = ""
blockPorn = ""
proxyList = []
uuid = getUUID(sni)
const uuid: UUID = getUUID(sni)
let configList: Array<Config> = []
for (let i = 0; i < max; i++) {
configList.push(GetVlessConfig(
i + 1,
uuid as UUID,
i + start,
uuid,
MuddleDomain(sni),
addressList[Math.floor(Math.random() * addressList.length)],
cfPorts[Math.floor(Math.random() * cfPorts.length)]
Expand All @@ -33,7 +32,7 @@ export async function GetVlessConfigList(sni: string, addressList: Array<string>
}

export async function VlessOverWSHandler(request: Request, sni: string, env: Env) {
uuid = getUUID(sni)
const uuid = getUUID(sni)
const [client, webSocket]: Array<WebSocket> = Object.values(new WebSocketPair)
webSocket.accept()

Expand Down

0 comments on commit c3aa1d7

Please sign in to comment.