-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Deno workflow and update configurations: streamline environm…
…ent setup, enhance test execution, and improve README links
- Loading branch information
EricZhou
committed
Nov 5, 2024
1 parent
4939e6e
commit 4c0e255
Showing
12 changed files
with
95 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.mp3 | ||
*.exe | ||
.idea/ | ||
.idea/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
# Edge Text to Speech with Deno.js | ||
[![JSR Score](https://jsr.io/badges/@mojocn/code/score)](https://jsr.io/@mojocn/codeape) | ||
|
||
[![JSR Score](https://jsr.io/badges/@mojocn/code/score)](https://jsr.io/@mojocn/codeape) | ||
|
||
## Youtube Videos Tutorial | ||
|
||
1. [Use Free Edge Text to Speech API with Deno.js](https://www.youtube.com/watch?v=uATgw1KVj_4) | ||
|
||
## Links | ||
|
||
|
||
## Links | ||
- [Edge browser TTS detail analysis by BurpSuite](https://github.com/mojocn/codeape/wiki/Microsoft-Edge-Browser-TTS-API-Request-Info-by-Burpsuit) | ||
- [Edge browser TTS detail analysis by BurpSuite](https://github.com/mojocn/codeape/wiki/Microsoft-Edge-Browser-TTS-API-Request-Info-by-Burpsuit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
|
||
|
||
export * from "./sse.ts"; | ||
export * from "./vless.ts"; | ||
export * from "./edgetts.ts"; | ||
export * from './sse.ts'; | ||
export * from './vless.ts'; | ||
export * from './edgetts.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { AuthFn, Session, TrafficFn } from './vless.ts'; | ||
|
||
function vlessProxy(request: Request): Response { | ||
const { socket, response } = Deno.upgradeWebSocket(request); | ||
const envUserUUID = Deno.env.get('USER_UUID') || ''; | ||
|
||
const checkAuth: AuthFn = (userUuidWithoutDashes: string): boolean => { | ||
return userUuidWithoutDashes === envUserUUID.replaceAll(/-/g, ''); | ||
}; | ||
const trafficFn: TrafficFn = (kk: string, trafficDeltaMB: number) => { | ||
console.info(`trafficFn: ${kk} ${trafficDeltaMB}`); | ||
}; | ||
const session = new Session(socket, checkAuth, trafficFn); | ||
session.start(); | ||
// record user's traffic | ||
return response; | ||
} | ||
|
||
async function handleRequest(request: Request): Promise<Response> { | ||
const env = Deno.env; | ||
if (request.headers.get('Upgrade') === 'websocket') { | ||
return await vlessProxy(request); | ||
} | ||
return new Response('Hello World', { | ||
headers: { 'content-type': 'text/plain' }, | ||
}); | ||
} | ||
|
||
export default { fetch: handleRequest }; | ||
//deno serve --allow-net --allow-env vless.ts |