tweedegolf / mailcrab

Email test server for development, written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It raise WebSocket error when binding to other ports on Docker image.

natsumesou opened this issue · comments

Hello.
When I bind HTTP port to 8025, it raise ws connection error on js console.

panicked at 'called Result::unwrap() on an Err value: JsError { name: "SyntaxError", message: "Failed to construct 'WebSocket': The URL contains a fragment identifier ('/ws'). Fragment identifiers are not allowed in WebSocket URLs." }', src/websocket.rs:31:45
Stack:
Error
at imports.wbg.__wbg_new_abda76e883ba8a5f (http://localhost:8025/static/mailcrab-frontend-b60440a4cc688da.js:368:21)

Uncaught (in promise) RuntimeError: unreachable
at __rust_start_panic (mailcrab-frontend-b60440a4cc688da_bg.wasm:0x258678)

My docker-compose.yaml

services:
  mail:
    image: marlonb/mailcrab
    ports:
      - '8025:1080'
      - '1025:1025'
commented

Hi @natsumesou Thank you for your report 👍

I was not able to reproduce your issue. When I startup the docker compose fragment you provided MailCrab is successfully served on http://localhost:8025/. What is the complete URL you are using to visit MailCrab? The error above suggest there might be a fragment in the URL (like http://localhost:8025#something) which is not supported.

commented

I was able to reproduce the error by adding a # to the end of my URL. Is there also an # at the end of the your URL? If so - does MailCrab function as expected when you remove this?

I was able to resolve the error by removing the # at the end of the URL.
After doing so, MailCrab worked as expected.
Thank you!