public class MiniHttpd extends Object
| 构造器和说明 |
|---|
MiniHttpd()
create a http server at random port which you can get by calling
getListeningPort() after start() |
MiniHttpd(int port) |
MiniHttpd(int port,
long responseDelayMS,
String responseJson) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getListeningPort() |
boolean |
isDebugMode() |
static void |
main(String[] args) |
int |
port() |
void |
setDebugMode(boolean debugMode) |
MiniHttpd |
start() |
void |
stop() |
public MiniHttpd(int port,
long responseDelayMS,
String responseJson)
port - the port number, or 0 to use a port number that is
automatically allocated.responseDelayMS - sleeping milliseconds before response outputting to clientsresponseJson - response message in json formatpublic MiniHttpd(int port)
public MiniHttpd()
getListeningPort() after start()public MiniHttpd start() throws IOException
IOExceptionpublic int getListeningPort()
public int port()
public void stop()
throws IOException
IOExceptionpublic boolean isDebugMode()
public void setDebugMode(boolean debugMode)
Copyright © 2017. All rights reserved.