Skip to content

mintmousse.start

Used to start the web console's server so it can start serving clients.

Can only be called on the main thread.

Synopsis

mintmousse.start( config )

Parameters

config table (nil)
A table of config values to use on startup.

Config Table

title string
The title to use for the web console. Also see mintmousse.setTitle.
host string
The host to bind the server to. If nil, default it is :: which tries to bind to IPv6 and IPv4, and fallbacks to * which tries to bind just to IPv4. See tcp:bind for documentation on host.
port number
The whole number port the server will be reachable on. If nil, default behaviour is to start at 8080 and will increment until it finds a port it can bind to.
autoIncrement boolean
If a port is given, if the server should try to increment the given port until it find ones. Default disabled. If port is nil, this will default to true.
whitelist string or table
A single rule, or an array of rules. See mintmousse.addToWhitelist for details.

Returns

Nothing.

Examples

mintmousse.start({ whitelist = "localhost" }) -- Quickstart

mintmousse.start({ -- Default
  title = "MintMousse",
  host = nil,
  port = nil,
  autoIncrement = false,
  whitelist = nil, -- Note, with no whitelist, no connections will be accepted
})

mintmousse.start({
  title = love.window.getTitle() .. " Console",
  host = "::",
  port = 80,
  autoIncrement = false,
  whitelist = {
    "localhost",         -- Covers "local", "127.0.0.1", and "::1"
    "192.168.4.27",      -- Specific IPv4 address
    "192.168.0.0/16",    -- Private IPv4 Range (CIDR)
    "10.0.0.0/8",        -- Large Private IPv4 Range
    "2001:db8::/32",     -- IPv6 Range CIDR
    "2001:db8::cafe",    -- Single IPv6 Host
    "::ffff:127.16.0.1", -- IPv4-mapped IPv6 address support
  },
})

See Also