TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: MockRTC – a mock peer and MitM proxy library for WebRTC

30 pointsby pimterryabout 3 years ago

1 comment

pimterryabout 3 years ago
I&#x27;ve _just_ published this package, so all of this is quite new!<p>It lets you define mock behaviour for a WebRTC peer in a couple of lines, and then connect to that mock using normal WebRTC APIs so you can write automated tests against reliable fake remote peers, quickly &amp; easily.<p>It can also proxy WebRTC traffic, basically by creating two connections and passing data &amp; media between them, and then hooking setup methods to automatically redirect your traffic through those. You just set up the hooks on your connection, then you connect to a real remote peer as normal, and everything gets intercepted (and then it can be rewritten, recorded, whatever you like).<p>At the moment the API is a little small, but all the traffic is intercepted and modifiable now, so extending that to cover whatever behaviours might be interesting should be relatively simple from here on, it&#x27;s just a question of what to include. I&#x27;ve mostly focused on datachannels since that&#x27;s more what I&#x27;m interested in right now, but ideas for more mock behaviours you&#x27;d find useful would be really helpful. Suggestions very welcome!
评论 #31272957 未加载