panel icon indicating copy to clipboard operation
panel copied to clipboard

Allow defining additional request origins for Wings websocket

Open Corenb opened this issue 6 years ago • 3 comments

Background (please complete the following information):

  • Panel or Daemon: Daemon
  • Version of Panel/Daemon: 1.0 beta release 8
  • Server's OS: Debian 9
  • Your Computer's OS & Browser: Win 10 + Mozilla Firefox

Describe the bug ezgif com-video-to-gif(1) Error in the console when trying to use server console : https://hastebin.com/ujubukohis.coffeescript

Corenb avatar Jul 28 '20 10:07 Corenb

Your hastebin link does not work, please just post the error contents in the issue itself rather than linking out of Github to avoid this issue in the future.

Additionally, this is most likely working correctly and your Panel URL in the wings configuration does not line up with the URL you're using in the browser, thus leading to the CORS error you're seeing since it by default ties itself to the panel URL origin.

DaneEveritt avatar Jul 28 '20 15:07 DaneEveritt

Ok so it's caused by accessing to the panel by a different URL then wich is configured ?

Here the error :

ERROR: [Jul 28 11:30:57.031] encountered HTTP/500 error while handling request error=websocket: request origin not allowed by Upgrader.CheckOrigin error_id=605810ff-2aca-4ee4-85e9-8c7ab6f9211e server=8fd72008-b2ac-496c-af4a-9bfe5267baba

Stacktrace:
github.com/pterodactyl/wings/router.(*RequestError).AbortWithStatus
        /home/runner/work/wings/wings/router/error.go:74
github.com/pterodactyl/wings/router.(*RequestError).AbortWithServerError
        /home/runner/work/wings/wings/router/error.go:95
github.com/pterodactyl/wings/router.getServerWebsocket
        /home/runner/work/wings/wings/router/router_server_ws.go:16
github.com/gin-gonic/gin.(*Context).Next
        /home/runner/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/pterodactyl/wings/router.ServerExists
        /home/runner/work/wings/wings/router/middleware.go:66

Corenb avatar Jul 28 '20 16:07 Corenb

Yes.

DaneEveritt avatar Jul 28 '20 17:07 DaneEveritt