You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Using the Interop to Create Webpages](#using-the-interop-to-create-webpages)
15
+
-[Examples](#examples)
16
+
9
17
## Features
10
18
11
19
- Serves files like a normal webserver
@@ -15,7 +23,38 @@ A very simple webserver that serves files from your local app data.
15
23
16
24
## Configuration
17
25
18
-
Todo!
26
+
Global configuration options are stored in `./Config/SharpConfig.json`
27
+
28
+
-`SafeMode` : If set to true the server will respond with dummy data instead of real webpages. Great for testing the extents of the server without exposing any real info.
29
+
-`PortNumber` : The port the server should bind to. On Unix family OSes ports below 1024 are *protected* and require super user permission to bind. Use `sudo` or choose a higher range port such as 8080.
30
+
31
+
The remote block list is stored in `bannedClients.json`
32
+
33
+
Each entry is simply an IP that is prohibited from connecting to the server.
34
+
35
+
## Launch Switches
36
+
37
+
Use `./SharpServer --help` to display this information in your terminal.
38
+
39
+
### Options
40
+
41
+
-`-h`, `--help` | Show the help screen
42
+
-`-p`, `--portable` | Launch in portable mode using the current directory instead of appdata
43
+
-`-l`, `--license` | output this program's license information and exit
44
+
45
+
> *Note*
46
+
>
47
+
> The default base directory when not launching in portable mode is `%localAppData%/RobynLlama/SharpWebserver` on windows and `~/.local/share/RobynLlama/SharpWebserver` on most Linux distros. See [Special Folders](https://learn.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=net-8.0) on the MSDN docs for more on where this location is on your system.
48
+
49
+
## Using Interactive Mode
50
+
51
+
The server continues to accept input from the terminal or console it was launched from during operation. The following commands are supported:
52
+
53
+
-`help` : Print all acceptable interactive commands
54
+
-`exit` : Save configs and exit immediately. No requests will be filled while shutting down.
55
+
-`ban` : Used like ban `IPAddress` this will immediately ban the remote associated with that IP address. Existing connections will not be closed but the client will be sent a notice they have been blocked and the connection ended on every subsequent request.
56
+
-`cache-clear` : Clears the existing webpage program cache. Great for testing and iterating on a page live.
57
+
-`config-reload` : Reloads all configs from disk without saving the current config. Be careful, any unsaved information will be lost. The block list is updated on disk after each entry so this is usually safe to use.
19
58
20
59
## Using the Interop to Create Webpages
21
60
@@ -24,7 +63,3 @@ All rendered webpage scripts should adhere to SharpWebserver.Interop.IScriptPage
24
63
### Examples
25
64
26
65
See [Examples](src/ExamplePages/README.md)
27
-
28
-
## Defaults
29
-
30
-
The default base directory is `%localAppData%/RobynLlama/SharpWebserver` on windows and `~/.local/share/RobynLlama/SharpWebserver` on most Linux distros. See [Special Folders](https://learn.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=net-8.0) on the MSDN docs for more on where this location is on your system.
0 commit comments