porting from lua-jet peer