mvm_gui_open_webserverT_mvm_gui_open_webserverMvmGuiOpenWebserverMvmGuiOpenWebserver (Operator)

Name

mvm_gui_open_webserverT_mvm_gui_open_webserverMvmGuiOpenWebserverMvmGuiOpenWebserver — Open a GUI webserver.

Signature

mvm_gui_open_webserver( : : Port, RootDir, AllowRemote : ServerHandle)

Herror T_mvm_gui_open_webserver(const Htuple Port, const Htuple RootDir, const Htuple AllowRemote, Htuple* ServerHandle)

void MvmGuiOpenWebserver(const HTuple& Port, const HTuple& RootDir, const HTuple& AllowRemote, HTuple* ServerHandle)

static void HHdevguiServerExtpack.MvmGuiOpenWebserver(HTuple port, HTuple rootDir, HTuple allowRemote, out HTuple serverHandle)

Description

Opens a GUI webserver which listens for connections at the local host on port PortPortPortPortport. The server supplies a HTTP server serving files from the directory RootDirRootDirRootDirRootDirrootDir and a WebSocket server. The returned ServerHandleServerHandleServerHandleServerHandleserverHandle should be used to close the webserver at the end of the program with mvm_gui_close_webservermvm_gui_close_webserverMvmGuiCloseWebserverMvmGuiCloseWebserverMvmGuiCloseWebserver.

The root directory of the server must be an absolute path to an existing directory or a path relative to the current working directory (see also set_current_dirset_current_dirSetCurrentDirSetCurrentDirSetCurrentDir). The directory is resolved immediately when this operator is executed. It is therefore OK to change the working directory afterwards.

Execution Information

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

PortPortPortPortport (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

GUI server port

Default value: 9980

RootDirRootDirRootDirRootDirrootDir (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

root directory. Only files in this directory or in its subdirectories are accessible.

Default value: '' "" "" "" ""

AllowRemoteAllowRemoteAllowRemoteAllowRemoteallowRemote (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

allow remote clients (contrary to allowing only access by the local host)

Default value: 'true' "true" "true" "true" "true"

List of values: 'false'"false""false""false""false", 'true'"true""true""true""true"

ServerHandleServerHandleServerHandleServerHandleserverHandle (output_control)  serial HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

GUI server handle

Example (HDevelop)

mvm_gui_open_webserver (9980, 'client/app/', true, ServerHandle)

See also

mvm_gui_close_webservermvm_gui_close_webserverMvmGuiCloseWebserverMvmGuiCloseWebserverMvmGuiCloseWebserver, close_handleclose_handleCloseHandleCloseHandleCloseHandle, mvm_gui_open_webclientmvm_gui_open_webclientMvmGuiOpenWebclientMvmGuiOpenWebclientMvmGuiOpenWebclient

Module

Foundation