Skip to content

Instantly share code, notes, and snippets.

@kenstir
kenstir / statsd_dissector.lua
Created May 24, 2021 15:52 — forked from jtai/statsd_dissector.lua
Wireshark dissector to decode statsd protocol
-- Usage: tshark -X lua_script:statsd_dissector.lua -r capture.pcap
-- Usage: tshark -X lua_script:statsd_dissector.lua -T fields -e statsd.metric_name -e statsd.value -e statsd.metric_type -r capture.pcap
local statsd = Proto("statsd","Statsd Protocol")
local pf_metric_name = ProtoField.new("Metric Name", "statsd.metric_name", ftypes.STRING)
local pf_value = ProtoField.new("Value", "statsd.value", ftypes.STRING)
local pf_metric_type = ProtoField.new("Metric Type", "statsd.metric_type", ftypes.STRING)
statsd.fields = { pf_metric_name, pf_value, pf_metric_type }
@kenstir
kenstir / strophe.xdomainrequest.js
Created July 20, 2011 20:20 — forked from iadvize/strophe.xdomainrequest.js
A Strophe plugin by iAdvize that use the XdomainRequest if found (Internet Explorer)
Strophe.addConnectionPlugin("xdomainrequest", {
init: function () {
if (window.XDomainRequest) {
Strophe.debug("using XdomainRequest for IE");
// override the send method to fire readystate 2
if (typeof XDomainRequest.prototype.oldsend == 'undefined') {
XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send;
XDomainRequest.prototype.send = function() {
XDomainRequest.prototype.oldsend.apply(this, arguments);