-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Http Obfuscation add basic parts
- Loading branch information
Showing
10 changed files
with
169 additions
and
54 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
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
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,11 +1,27 @@ | ||
import Connection from '../helper/connection' | ||
|
||
abstract class ObfsMethod { | ||
public static readonly CLIENT = 'CLIENT' | ||
public static readonly SERVER = 'SERVER' | ||
public type: typeof ObfsMethod.CLIENT | typeof ObfsMethod.SERVER | ||
protected connection: Connection | ||
constructor( | ||
connection: Connection, | ||
type: typeof ObfsMethod.CLIENT | typeof ObfsMethod.SERVER | ||
) { | ||
this.connection = connection | ||
this.type = type | ||
} | ||
public abstract name: string | ||
public abstract check(message: Buffer): boolean | ||
public abstract handshake(connection: Connection): void | ||
public abstract handshake(callback: () => void): void | ||
public abstract deObfuscate(message: Buffer): Buffer | ||
public abstract obfuscate(message: Buffer): Buffer | ||
} | ||
|
||
export type ObfsBuilder = ( | ||
connection: Connection, | ||
type?: typeof ObfsMethod.CLIENT | typeof ObfsMethod.SERVER | ||
) => ObfsMethod | ||
|
||
export default ObfsMethod |
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
Oops, something went wrong.