title: Redis, Python send message over network
body: <p>I have the following code written in Python using the Redis PubSub messaging system. </p>
  
  <p>Publish side:</p>
  
  <pre><code> import redis
   def func1(m):
  
   queue = redis.StrictRedis(host='localhost', port=6379, db=0)
   channel = queue.pubsub()
   queue.publish("message", m)
  
   if __name__=='__main__':    
   while True:
  
       m = raw_input('Enter message: ')
       func1(m)
  </code></pre>
  
  <p>Subscriber side:</p>
  
  <pre><code>import redis
  r = redis.StrictRedis(host='localhost', port=6379, db=0)
  p = r.pubsub()
  p.subscribe('message')
  
  while True:
      message = p.get_message()
      if message:
          print  message['data']
  </code></pre>
  
  <p>I want to be able to send messages from one computer to another that are on the same network. I tried running the publisher and subscriber code on two separate machines, changing the host='localhost' to host='IP address of target machine'
  But when I ran it the subscribers program just sat idle and did not receive any messages. </p>
  
  <p>How do you use Redis over a network instead of just on a local machine? 
  Do I need to specify target machine IP's on both the pub and sub sides? 
  I can not find any concrete example online , everything I find just assumes that you are running it on a localhost.</p>