Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
403 Prohibido cuando se conecta a pterodactyl websocket

Me preguntaba si alguien me podría ayudar. Estoy haciendo un programa que se conecta al websocket de pterodactyl pero cada vez que intento conectarme me da un 403 - Prohibido. He estado investigando este error durante algunas horas y parece que no puedo encontrar una solución. Estoy usando NodeJS v17.

Aquí está el código:

 const embed = require('../../Configs/embed.json'); let PterodactylUser = require('../../Structures/Panel/PterodactylUser.js'); const SQL = require('../../Structures/Panel/SQL/SQL.js'); const mainConfig = require('../../Configs/config.json'); const WebSocket = require("ws"); module.exports = { name: 'Output', description: 'Sends live console output for the selected server!', category: 'Servers', enabled: true, options: [ { name: "start", type: "SUB_COMMAND", description: "Starts sending console output for the server.", options: [ { name: "id", type: "STRING", description: "The ID of the server to link!", required: true }, { name: "channel", type: "CHANNEL", channelTypes: ["GUILD_TEXT", "GUILD_NEWS"], description: "The channel to link if not set uses current channel!" } ] } ], needsAPIKey: true, async execute(client, Discord, mainConfig, interaction, args) { const user = interaction.user || interaction.author; const channel = args.getChannel('channel') ? args.getChannel('channel') : interaction.channel; const serverId = args.getString('id'); const mysql = new SQL(); let apiKey = await mysql.getApiKey(user.id, interaction.guild.id); let res = await new PterodactylUser(apiKey).getWebsocket(serverId); const { socket, token } = res.data; const ws = new WebSocket(socket); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tuve un problema similar causado por configuraciones de acceso al panel mal configuradas. Debe editar /etc/pterodactyl/config.yml

Citando al creador de la biblioteca PteroJS de mi problema :

El origen de la solicitud de websocket no está en la lista blanca. Si tiene acceso a Wings para el nodo que está utilizando, configure allowed_origins en "config.yml" para esto:

 allowed_origins: - "*"

De lo contrario, comuníquese con el administrador de su panel al respecto.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!