相关文章推荐
打盹的大熊猫  ·  pyspark读取数据 - ...·  1 月前    · 
憨厚的大脸猫  ·  continue in if else ...·  1 年前    · 
独立的脆皮肠  ·  还没适配 Android 12 ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

When I use Charles Proxy for iOS and play some games, I recognize that they etablish connections with the protocol prefix "socket://" followed by an IP address (instead of a hostname, which is always present for other HTTP(s) connections). I'd assume that those are websockets.

Currently, I'm trying to implement a tool to track rudimentary network activity. To archive that, I'm using the NEKit ( https://zhuhaow.me/NEKit/ ) in combination with the NEPacketTunnelProvider extension for iOS. Using that, I was able to set up a local HTTP Proxy server and setup the network interface to redirect every HTTP(s) request over that local proxy. Through an observer, I was able to see all the requested hostnames.

Now I found out, that some games (those which are using websockets) are not working properly with my solution. Regarding to this discussion https://news.ycombinator.com/item?id=16694670 it seems like proxying the HTTP(s) data flow doesn't enable me to handle websocket connections:

Yes, but the problem with Charles (well, iOS related at least) is that iOS websockets don't go through the HTTP Proxy configured. They're just considered a raw socket. Thus, even on desktop Charles, it's a nogo.

Due to that, some apps don't even work when my tracker is enabled, since they can't etablish a connection to their servers.

Is there the possibility to archive something similar for the websocket connections since the combination of GCDHTTPProxyServer ( NEKit ) and NEProxySettings ( NetworkExtension ) is only working for HTTP(s)? How can I track and (even better) proxy websocket connections?

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .