|
31 | 31 |
|
32 | 32 | def run(*args): |
33 | 33 | TESTNET = args[0] |
| 34 | + HTTPPORT = args[1] |
34 | 35 |
|
35 | 36 | # Create the database |
36 | 37 | db = Database(testnet=TESTNET) |
@@ -187,7 +188,7 @@ def render_GET(self, request): |
187 | 188 | return server.NOT_DONE_YET |
188 | 189 |
|
189 | 190 | server_protocol = server.Site(WebResource(kserver)) |
190 | | - reactor.listenTCP(8080, server_protocol) |
| 191 | + reactor.listenTCP(HTTPPORT, server_protocol) |
191 | 192 |
|
192 | 193 | reactor.run() |
193 | 194 |
|
@@ -225,13 +226,14 @@ def start(self): |
225 | 226 | python openbazaard.py start [-d DAEMON]''') |
226 | 227 | parser.add_argument('-d', '--daemon', action='store_true', help="run the server in the background") |
227 | 228 | parser.add_argument('-t', '--testnet', action='store_true', help="use the test network") |
| 229 | + parser.add_argument('-p', '--port', help="set the http port", default=8080) |
228 | 230 | args = parser.parse_args(sys.argv[2:]) |
229 | 231 | print "OpenBazaar Seed Server v0.1 starting..." |
230 | 232 | unix = ("linux", "linux2", "darwin") |
231 | 233 | if args.daemon and platform.system().lower() in unix: |
232 | | - self.daemon.start(args.testnet) |
| 234 | + self.daemon.start(args.testnet, int(args.port)) |
233 | 235 | else: |
234 | | - run(args.testnet) |
| 236 | + run(args.testnet, int(args.port)) |
235 | 237 |
|
236 | 238 | def stop(self): |
237 | 239 | # pylint: disable=W0612 |
|
0 commit comments