Weird, I commented out that line in my /etc/hosts and got the exact same error you have so the line about the port might be a red herring. The main issue is it can’t resolve localhost.rig.twitch.tv I believe.
Do you get anything with ping localhost.rig.twitch.tv
It should resolve to 127.0.0.1