mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 00:25:56 +03:00
[GH-ISSUE #1135] Proxyman swallows the first message in Action Cable websocket #1131
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tkrajacic on GitHub (Feb 4, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1135
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
Version 3.0.0 (30000)
macOS Version? (Ex. mac 10.14)
12.2 (21D49)
Steps to reproduce
connect to an Action Cable Websocket using either Android or iOS
The welcome message never arrives at the client when Proxyman is intercepting traffic
Expected behavior
The initial welcome message that the Action Cable protocol sends is received
So I am not 100% certain this is Proxyman's fault, but the Action Cable Rails code unconditionally sends a
{"type":"welcome"}message when a websocket is opened. (github.com/rails/rails@18707ab17f/actioncable/lib/action_cable/connection/base.rb (L175))I am developing an iOS and Android app (this iOS app still uses Starscream, so I can actually see the websocket messages in Proxyman), the apps never receive the welcome message from Rails. As soon as I quit Proxyman (or I use the URLSessionWebSocketTask, which Proxyman doesn't intercept) all apps do get this message when connecting.
The WebSocket does get established in any case, and messages can be sent. So it is not that the WebSocket connection is failing. Clients do get the callback that the socket was opened successfully.
This is 100% reproducible. I have no idea how this could be Rails fault, so I am naïvely assuming it has to do something with Proxyman.
Could it be that Rails is sending its message so quickly that Proxyman drops it, as it isn't ready yet?
P.S.: I tried connecting using
websocatfrom the command line, which also isn't intercepted by Proxyman, and the welcome message appears as expected.P.P.S: I now tried with
wscat, which allows me to easily optionally use a http proxy and indeed, without proxy this works fine, and as soon as I use Proxyman, the welcome message disappears.@NghiaTranUIT commented on GitHub (Feb 4, 2022):
Thanks for your detailed issue. It’s super helpful for me to investigate the bug 👍
I’m on it and send you a Beta build soon 😊
@NghiaTranUIT commented on GitHub (Feb 5, 2022):
@tkrajacic if you don't mind, please check out this build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.0.0_Missing_the_first_ws_message.dmg
I was able to reproduce the bug and it now displays the first WS message 👍
Please let me know the result 😄
@tkrajacic commented on GitHub (Feb 5, 2022):
Fantastic! Works like a charm now! Thank you!
Just out of curiosity, what was it? Why did no one else see this? :)
@NghiaTranUIT commented on GitHub (Feb 5, 2022):
Technically, there was a small bug after initializing the WebSocket from Proxyman. I forgot to forward the first byte to the server. Therefore, Proxyman would never retrieve "the first" WS message from the server.
If the first message is from the client (not from the server), it works as expected 👍
I guess people didn't see it because after establishing the WS, the client always sent the first message. So, there was no bug.