Skip to content

Commit

Permalink
Added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaron committed Jul 24, 2023
1 parent f8e27e4 commit debbb87
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions roboquant/src/main/kotlin/org/roboquant/http/WebServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import org.roboquant.orders.lines
import java.io.OutputStream
import java.net.InetSocketAddress


/**
* Metric used to capture basic information of a run that is displayed on the web pages.
*/
private class WebMetric : Metric {

var account: Account? = null
Expand Down Expand Up @@ -103,9 +105,17 @@ internal class Authenticator(private val username: String, private val password:
}

/**
* Very lightweight webserver that enables to run a trading strategy and view some key metrics while it is running.
* There is support for basic-auth, but this is not very secure since username & password are sent in plain-text
* to the server.
* Very lightweight webserver that enables you to run a trading strategy and view some key metrics while it is running.
* There is support for basic-auth, but this is not very secure since username & password are sent in
* plain-text to the server.
*
* Example:
*
* ```
* val ws = WebServer()
* ws.runAsync(roboquant, feed, Timeframe.next(8.hours))
* ws.start()
* ```
*
* This server might be replaced in the future for a more secure solution.
*
Expand Down Expand Up @@ -133,7 +143,7 @@ class WebServer(port: Int = 8000, username: String, password: String) {
val warmup: TimeSpan = TimeSpan.ZERO
)


// basic bootstrap page
private val template = """
<!doctype html>
<html lang="en">
Expand Down

0 comments on commit debbb87

Please sign in to comment.