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 more code examples to lisp #542

Merged
merged 3 commits into from
Nov 17, 2023
Merged

Add more code examples to lisp #542

merged 3 commits into from
Nov 17, 2023

Conversation

vinc
Copy link
Owner

@vinc vinc commented Nov 12, 2023

  • NTP client
  • Fetch client

@vinc
Copy link
Owner Author

vinc commented Nov 12, 2023

The NTP code is inspired by https://seriot.ch/projects/tiny_ntp_client.html

~
> host pool.ntp.org
5.196.8.113

~
> lisp /tmp/lisp/ntp.lsp 5.196.8.113
1699815734

@vinc
Copy link
Owner Author

vinc commented Nov 12, 2023

The last commit adds a client to Fetch, a HTTP/0.9 server and proxy to other protocols like HTTPS and Gemini.

~
> lisp /tmp/lisp/fetch.lsp https://example.com
<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

With the following running on the host system if MOROS is running on QEMU:

~
> ruby fetchd.rb --proxy
127.0.0.1 - - GET https://example.com 200 1256

@vinc vinc marked this pull request as ready for review November 17, 2023 09:08
@vinc vinc merged commit b77e886 into trunk Nov 17, 2023
1 check passed
@vinc vinc deleted the feature/lisp-examples branch November 17, 2023 09:08
@vinc vinc mentioned this pull request Dec 22, 2023
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