set protocol var before creating server