Função principal que gerencia verificações de conexão com medidas de segurança
Parameters:
Name | Type | Description |
---|---|---|
req |
Object | Objeto de requisição HTTP |
res |
Object | Objeto de resposta HTTP |
httpsServer |
Object | Servidor HTTPS |
isCheck |
boolean | Flag para verificação simples |
Returns:
Status da conexão (true/false)
- Type
- boolean
Methods
(inner) configureExpressApp(app)
Configura middlewares do Express
Parameters:
Name | Type | Description |
---|---|---|
app |
Object | Aplicação Express principal |
(inner) configureHttpRedirect(httpApp)
Configura redirecionamento HTTP para HTTPS
Parameters:
Name | Type | Description |
---|---|---|
httpApp |
Object | Aplicação Express para HTTP |
(inner) configureWebSocket(httpsServer)
Configura WebSocket Server e eventos de upgrade
Parameters:
Name | Type | Description |
---|---|---|
httpsServer |
Object | Servidor HTTPS principal |
(inner) createServers(app, httpApp) → {Object}
Cria servidores HTTP e HTTPS
Parameters:
Name | Type | Description |
---|---|---|
app |
Object | Aplicação Express principal |
httpApp |
Object | Aplicação Express para HTTP |
Returns:
Objeto com servidores criados
- Type
- Object
(inner) displayLoginInfo()
Exibe informações de login no console
(inner) executePostAction(kill, jsonData) → {Object}
Executa ação baseada nos dados POST
Parameters:
Name | Type | Description |
---|---|---|
kill |
Object | Objeto de controle |
jsonData |
Object | Dados da requisição |
Returns:
Resposta da ação
- Type
- Object
(inner) handleEditorRoute(httpsServer) → {function}
Manipula rota do editor de configurações
Parameters:
Name | Type | Description |
---|---|---|
httpsServer |
Object | Servidor HTTPS |
Returns:
Middleware para rota do editor
- Type
- function
(inner) handleHomepage(req, res)
Manipula rota da homepage
Parameters:
Name | Type | Description |
---|---|---|
req |
Object | Requisição |
res |
Object | Resposta |
(inner) handlePostRequest(kill) → {function}
Manipula requisições POST para envio de mensagens
Parameters:
Name | Type | Description |
---|---|---|
kill |
Object | Objeto de controle |
Returns:
Middleware para rota POST
- Type
- function
(inner) handleUpgradeRequest(wss, request, socket, head)
Manipula solicitações de upgrade para WebSocket
Parameters:
Name | Type | Description |
---|---|---|
wss |
Object | WebSocket Server |
request |
Object | Objeto de requisição |
socket |
Object | Socket de conexão |
head |
Buffer | Cabeçalhos da requisição |
(inner) handleWebSocketConnection(ws)
Manipula conexões WebSocket
Parameters:
Name | Type | Description |
---|---|---|
ws |
Object | WebSocket conectado |
(inner) isValidMessage(jsonData) → {boolean}
Verifica se um objeto JSON contém todos os campos necessários para enviar uma mensagem válida
Parameters:
Name | Type | Description |
---|---|---|
jsonData |
Object | Objeto JSON a ser validado |
Returns:
Retorna true se a mensagem é válida, false caso contrário
- Type
- boolean
(inner) setupInternalWebSocket(httpsServer)
Configura WebSocket interno para comunicação
Parameters:
Name | Type | Description |
---|---|---|
httpsServer |
Object | Servidor HTTPS |
(inner) setupRoutes(app, httpsServer, httpApp, kill)
Configura todas as rotas da aplicação
Parameters:
Name | Type | Description |
---|---|---|
app |
Object | Aplicação Express principal |
httpsServer |
Object | Servidor HTTPS |
httpApp |
Object | Aplicação Express para HTTP |
kill |
Object | Objeto de controle |
(inner) startServers(httpServer, httpsServer)
Inicia servidores HTTP e HTTPS
Parameters:
Name | Type | Description |
---|---|---|
httpServer |
Object | Servidor HTTP |
httpsServer |
Object | Servidor HTTPS |
(inner) validateAuth(request) → {boolean}
Valida credenciais de autenticação
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | Objeto de requisição |
Returns:
Resultado da validação
- Type
- boolean
(inner) validatePostRequest(jsonData) → {boolean}
Valida requisição POST
Parameters:
Name | Type | Description |
---|---|---|
jsonData |
Object | Dados da requisição |
Returns:
Resultado da validação
- Type
- boolean