WSr is a server that serves requests for websocketconnections.
- If you want to specify what ip and port the server will listen to you can edit Program.cs
- In Program.cs you can also experiment with supplying you own logic to the serve call.
public static IObservable<Unit> Serve(
IConnectedSocket socket,
Func<byte[]> bufferfactory,
Action<string> log,
Func<IObservable<Message>, IObservable<Message>> app,
IScheduler s = null)
parameter | purpose |
---|---|
bufferfactory | experiment with different way of allocating bytes coming in from connected sockets. Each receive from this socket will be allocated to the bytearray produced by this function. |
log | the action will receive string logmessages from the run |
app | the server wil run this function on every dataframe it receives on this socket. |
scheduler | provide a scheduler (the IO-operations will be scheduled on it) |
dotnet run
- The server will begin listening for websocket handshake-requests
- If it receives a handshake-request it will maintain the connection with the client and interpret the following transmission as websocketframes
- Find a way to connect to WSr yourself or test the server with a thorough fuzzer
- Have fun!
Assuming your working directory is where the docker file is at:
docker build -t tag/name . && docker run -d -p 127.0.0.1:9001:80 tag/name
WSr requires dotnet SDK. Also it requires you to be able to download nuget packages. See csproj for dependencies dotnet restore
should do the trick if not just running it doesn´t.
There's not really so much you need to do to install WSr. The only required step is to clone the repo:
git clone https://github.com/goekboet/wsr.git
Downloading a fuzzer good for testing. I use autobahn and there are some simple macros for easy test from the commandline included in the repo.
The project has unit-tests that aim to cover the core logic. Each function that transforms the observable should have a corresponding test.
dotnet test
For integration testing I use autobahn and there are some simple macros for easy test from the commandline included in the repo.
If you have them you can open an issue and I'll get back to you asap.