Dev json xff v0.5

New version based on previous PR #1241