Skip to content

Commit 47bd490

Browse files
author
Mohit Shah
committed
Added routine to find ip address and feed it to cherrypy
1 parent e0a8a41 commit 47bd490

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

syntaxnet/glib/server.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import cherrypy, time
55
import numpy as np
66
import glib
7+
import netifaces as ni
78

89

910
class Root:
@@ -34,7 +35,8 @@ def index(self, **params):
3435

3536

3637
def main():
37-
cherrypy.config.update({'server.socket_host': '192.168.1.35',
38+
ip = ni.ifaddresses('eth0')[2][0]['addr']
39+
cherrypy.config.update({'server.socket_host': ip,
3840
'server.socket_port': 7204,
3941
'server.thread_pool': 30})
4042
conf = {}

0 commit comments

Comments
 (0)