Documentation ¶
Index ¶
- Constants
- Variables
- func GetAccessToken(accessToken string) string
- func GetArkoseToken(apiVersion int, dx string) (string, error)
- func GetPUID(accessToken string) string
- func NewHttpClient() tls_client.HttpClient
- func Proxy(c *gin.Context)
- func RefreshAccessToken(refreshToken string) string
- func ReturnMessage(msg string) gin.H
- type AuthLogin
- type LoginInfo
Constants ¶
View Source
const ( ChatGPTApiPrefix = "/chatgpt" ChatGPTApiUrlPrefix = "https://chatgpt.com" PlatformApiPrefix = "/platform" PlatformApiUrlPrefix = "https://api.openai.com" AuthorizationHeader = "Authorization" XAuthorizationHeader = "X-Authorization" ArkoseTokenHeader = "Openai-Sentinel-Arkose-Token" ContentType = "application/x-www-form-urlencoded" UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" Auth0Url = "https://auth0.openai.com" LoginUsernameUrl = Auth0Url + "/u/login/identifier?state=" LoginPasswordUrl = Auth0Url + "/u/login/password?state=" ParseUserInfoErrorMessage = "Failed to parse user login info." GetAuthorizedUrlErrorMessage = "Failed to get authorized url." EmailInvalidErrorMessage = "Email is not valid." EmailOrPasswordInvalidErrorMessage = "Email or password is not correct." GetAccessTokenErrorMessage = "Failed to get access token." ReadyHint = "Service go-chatgpt-api is ready." RobotsHint = "User-agent: *\nDisallow: /" AccountDeactivatedErrorMessage = "Account %s is deactivated." EmailKey = "email" Language = "en-US" )
Variables ¶
View Source
var ( Client tls_client.HttpClient ArkoseClient tls_client.HttpClient PUID string OAIDID string ProxyUrl string IMITATE_accessToken string StartTime = time.Now() )
Functions ¶
func GetAccessToken ¶
func NewHttpClient ¶
func NewHttpClient() tls_client.HttpClient
func RefreshAccessToken ¶
func ReturnMessage ¶
Types ¶
type AuthLogin ¶
type AuthLogin interface { GetAuthorizedUrl(csrfToken string) (string, int, error) GetState(authorizedUrl string) (string, int, error) CheckUsername(state string, username string) (int, error) CheckPassword(state string, username string, password string) (string, int, error) GetAccessToken(code string) (string, int, error) }
Click to show internal directories.
Click to hide internal directories.