It looks good. I would recommend checking some of the basics.
What output do you get on the USER screen? This can help you determine if the connection is made.
1. MSG_CONNECT( 'S3: ' , status) Why is there a space after the colon?
2. I don't think you need to set a port number or a server IP in the Host Comm settings. You are setting the port in your Karel code.
3. Are you testing this in Roboguide? If yes, then you can use telnet on your PC as a simple test to verify your Socket Messaging settings are correct. Open telnet and run the command "open 127.0.0.1 8000" (assuming you use port 8000). Then monitor the USER screen on the robot to see if you get the "Connect Status =" message. If you are able to connect you can send some characters in telnet.
4. In Host Comm, check the HTTP Authentication screen. Verify that Karel is set to "Unlock".