npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whistle.show-frames

v1.0.1

Published

Use to display websocket/socket frames in the whistle webui

Downloads

7

Readme

whistle.show-frames

用来在whistle中显示TCP/Socket请求的数据包,该插件不做中转服务,只是把接收到的数据展示到whistle的Network界面的Frames面板里面。

安装

npm i -g whistle whistle.show-frames

使用

如果是Node应用可以借助socketx(与whistle建立tunnel代理)、simpleproto(简单的长连接传输协议,whistle.show-frames是按照这个协议接收请求)实现:

// 与whistle建立长连接
const { connect } = require('socketx');
const { encode } = require('simpleproto');

(async () => {
	const proxy = {
		host: '127.0.0.1', // whistle所在机器IP,根据实际情况填写
		port: 8899, // whistle默认端口,根据实际情况填写
		headers: {
			'x-whistle-show-frames': 1, // 必填,插件会根据此代理请求头转到服务
		}
	};
	const client = await connect({
		host: 'www.test.com', // 显示在whistle请求列表的标识,任意Latin字母字符串都可以
		port: 1234, // 显示在whistle请求列表的标识,任意数字都可以
		proxy,
	});
	// 断开要重连
	client.on('close', () => {});
	client.on('error', (e) => console.error(e));
	let index = 0;
	setInterval(() => {
		++index;
    // req和res自动都是可选,分别会在Frames里面展示发送和接收状态的数据,空则不显示
		const data = `{"req": "${index}. request data", "res": "${index}. response data"}`;
		console.log('send data length:', data.length);
		client.write(encode(data));
	}, 3000);
})();

show-frames

应用

可以作为展示长连接数据包的服务,这个行为是异步进行的,不影响正常的收发请求。 架构图