Skip to content

Different ports for https and ws? #600

Description

@shsmad

We have custom installation of mattermost, which have https port 443, and websocket port 9444. Can mmpy_bot be configured so it use different ports for https and ws? Now when I start bot I got:

[10/27/2025 15:50:40][httpx][DEBUG] load_ssl_context verify=False cert=None trust_env=True http2=False
[10/27/2025 15:50:40][httpcore.connection][DEBUG] connect_tcp.started host='…' port=443 local_address=None timeout=None socket_options=None
[10/27/2025 15:50:40][httpcore.connection][DEBUG] connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x74ff890ac0d0>
[10/27/2025 15:50:40][httpcore.connection][DEBUG] start_tls.started ssl_context=<ssl.SSLContext object at 0x74ff883fea40> server_hostname='…' timeout=None
[10/27/2025 15:50:40][httpcore.connection][DEBUG] start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x74ff890ac0a0>
[10/27/2025 15:50:40][httpcore.http11][DEBUG] send_request_headers.started request=<Request [b'GET']>
[10/27/2025 15:50:40][httpcore.http11][DEBUG] send_request_headers.complete
[10/27/2025 15:50:40][httpcore.http11][DEBUG] send_request_body.started request=<Request [b'GET']>
[10/27/2025 15:50:40][httpcore.http11][DEBUG] send_request_body.complete
[10/27/2025 15:50:40][httpcore.http11][DEBUG] receive_response_headers.started request=<Request [b'GET']>
[10/27/2025 15:50:40][httpcore.http11][DEBUG] receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Server', b'QRATOR'), (b'Date', b'Mon, 27 Oct 2025 12:50:40 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'775'), (b'Connection', b'keep-alive'), (b'Keep-Alive', b'timeout=15'), (b'x-version-id', b'10.11.10.1883.612afc64cfaa5572f14203cfbaf01d39.true'), (b'x-request-id', b'94skwfgtppg7zm3w61gwj95oio'), (b'etag', b'10.11.10.4tynum6h3by3udo8eg1ie4opga.1761400241610..0.true.true.0'), (b'expires', b'0'), (b'vary', b'Origin'), (b'vary', b'Accept-Encoding'), (b'x-content-type-options', b'nosniff'), (b'strict-transport-security', b'max-age=31536000; includeSubDomains; preload'), (b'referrer-policy', b'no-referrer')])
[10/27/2025 15:50:40][httpx][INFO] HTTP Request: GET https://…/api/v4/users/me "HTTP/1.1 200 OK"
[10/27/2025 15:50:40][httpcore.http11][DEBUG] receive_response_body.started request=<Request [b'GET']>
[10/27/2025 15:50:40][httpcore.http11][DEBUG] receive_response_body.complete
[10/27/2025 15:50:40][httpcore.http11][DEBUG] response_closed.started
[10/27/2025 15:50:40][httpcore.http11][DEBUG] response_closed.complete
[10/27/2025 15:50:40][mmpy.bot][INFO] Starting bot Bot.
[10/27/2025 15:50:40][mmpy.plugin_base][DEBUG] Plugin HelpPlugin started!
[10/27/2025 15:50:40][mmpy.plugin_base][DEBUG] Plugin ExamplePlugin started!
[10/27/2025 15:50:40][mmpy.plugin_base][DEBUG] Plugin WebHookExample started!
[10/27/2025 15:50:40][mmpy.threadpool][INFO] Scheduler thread started.
[10/27/2025 15:50:40][asyncio][DEBUG] Using selector: EpollSelector
[10/27/2025 15:50:40][mattermostautodriver.websocket][ERROR] Failed to establish websocket connection: <class 'aiohttp.client_exceptions.WSServerHandshakeError'> thrown
Traceback (most recent call last):
  File "/test_mm_bot/.venv/lib/python3.9/site-packages/mattermostautodriver/websocket.py", line 54, in connect
    async with session.ws_connect(
  File "/test_mm_bot/.venv/lib/python3.9/site-packages/aiohttp/client.py", line 1517, in __aenter__
    self._resp: _RetType = await self._coro
  File "/test_mm_bot/.venv/lib/python3.9/site-packages/aiohttp/client.py", line 1100, in _ws_connect
    raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://…/api/v4/websocket'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions