[GH-ISSUE #126] WSS Calls - Always use the IP:PORT instead of the current UI origin #83

Closed
opened 2026-03-15 12:27:37 +03:00 by kerem · 3 comments
Owner

Originally created by @sgalinski on GitHub (Jun 10, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/126

Problem: I'm proxying the UI to have a more readable name for internal reasons. The WSS calls fail, because of a wrong destination.

image

This seems to be the problematic code.

		wsproto + "://" + document.location.host + document.location.pathname + "api/events"

This could also be a configuration option. I hope that this can be implemented. Mailpit is a real great successor of Mailhog. :)

Originally created by @sgalinski on GitHub (Jun 10, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/126 Problem: I'm proxying the UI to have a more readable name for internal reasons. The WSS calls fail, because of a wrong destination. ![image](https://github.com/axllent/mailpit/assets/122370/53723f37-96e9-4098-b4b6-24a9cd55a988) This seems to be the problematic code. wsproto + "://" + document.location.host + document.location.pathname + "api/events" This could also be a configuration option. I hope that this can be implemented. Mailpit is a real great successor of Mailhog. :)
kerem closed this issue 2026-03-15 12:27:42 +03:00
Author
Owner

@axllent commented on GitHub (Jun 10, 2023):

The secure websocket connections are using the same host as the web UI, so the issue/solution here is not that you need to manually override the wss path, it is that your proxy isn't configured properly to proxy websockets. Please see the first section on https://github.com/axllent/mailpit/wiki/Troubleshooting and let me know if this solves your issue?

<!-- gh-comment-id:1585814132 --> @axllent commented on GitHub (Jun 10, 2023): The secure websocket connections are using the same host as the web UI, so the issue/solution here is not that you need to manually override the wss path, it is that your proxy isn't configured properly to proxy websockets. Please see the first section on https://github.com/axllent/mailpit/wiki/Troubleshooting and let me know if this solves your issue?
Author
Owner

@sgalinski commented on GitHub (Jun 11, 2023):

Thanks. This works pretty well after some research including your mentioned links.

BTW: Here is a chef cookbook for Mailpit. It contains the installation, auto-start with systemd and the apache proxy configuration. Maybe helpful for someone else: https://gitlab.sgalinski.de/chef-cookbooks/mailpit
The cookbook depends a little bit on other ones like https://gitlab.sgalinski.de/chef-cookbooks/normal_site and https://gitlab.sgalinski.de/chef-cookbooks/ubuntu_base

I hope that this helps someone else as I didn't found any concrete implementation myself.

<!-- gh-comment-id:1586142091 --> @sgalinski commented on GitHub (Jun 11, 2023): Thanks. This works pretty well after some research including your mentioned links. BTW: Here is a chef cookbook for Mailpit. It contains the installation, auto-start with systemd and the apache proxy configuration. Maybe helpful for someone else: https://gitlab.sgalinski.de/chef-cookbooks/mailpit The cookbook depends a little bit on other ones like https://gitlab.sgalinski.de/chef-cookbooks/normal_site and https://gitlab.sgalinski.de/chef-cookbooks/ubuntu_base I hope that this helps someone else as I didn't found any concrete implementation myself.
Author
Owner

@axllent commented on GitHub (Jun 12, 2023):

Thanks for the feedback / links @sgalinski, and glad to hear you got it sorted. Unfortunately documenting the exact steps isn't possible because everyone has a different configurations to proxy, and there are many solutions that can be used to proxy http traffic. I'm closing this as resolved.

<!-- gh-comment-id:1586565541 --> @axllent commented on GitHub (Jun 12, 2023): Thanks for the feedback / links @sgalinski, and glad to hear you got it sorted. Unfortunately documenting the exact steps isn't possible because everyone has a different configurations to proxy, and there are many solutions that can be used to proxy http traffic. I'm closing this as resolved.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#83
No description provided.