Dev json xff v0.4

New version based on previous PR #1111.