Use protocol from javascript instead of replacing it serverside