[wip] re-implementing proxy as library