Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a web server #114

Merged
merged 15 commits into from
Nov 15, 2020
Merged

Add a web server #114

merged 15 commits into from
Nov 15, 2020

Conversation

vinc
Copy link
Owner

@vinc vinc commented Nov 11, 2020

No description provided.

@vinc
Copy link
Owner Author

vinc commented Nov 11, 2020

The last couple of commits are kind of like reinventing FTP over HTTP but at the moment our FUSE driver is read only and this is quite simple to write to live update the file system:

HTTP Server listening on 0.0.0.0:80
10.0.2.2 - - [11/Nov/2020:18:36:43 +0000] "GET /tmp/hello.txt" 404 20
10.0.2.2 - - [11/Nov/2020:18:36:58 +0000] "PUT /tmp/hello.txt" 200 0
10.0.2.2 - - [11/Nov/2020:18:37:02 +0000] "GET /tmp/hello.txt" 200 15
10.0.2.2 - - [11/Nov/2020:18:37:09 +0000] "DELETE /tmp/hello.txt" 200 0
10.0.2.2 - - [11/Nov/2020:18:37:19 +0000] "GET /tmp/hello.txt" 404 20

@vinc
Copy link
Owner Author

vinc commented Nov 15, 2020

The server has a few major limitations that will need to be addressed later:

  • Concurrency is not supported
  • Requests larger than the MTU are not supported
  • Chroot is not supported

Concurrency will be implemented when threads are available, and the second one might be handled at the network driver level.

The file transfer protocol is therefor limited to files below the MTU size, and while we can read, write, and delete files, we can only read and write directories, it's not currently possible to delete them. This part of the code should probably be moved to a proper FTP or TFTP server.

Finally we should support the concept of index.html files to manually replace automatic directory listing.

@vinc vinc marked this pull request as ready for review November 15, 2020 08:41
@vinc vinc changed the title Add HTTP server Add a web server Nov 15, 2020
@vinc vinc merged commit 9d09d1b into master Nov 15, 2020
@vinc vinc deleted the feature/http-server branch November 15, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant