Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aschuhardt/Opal
A .NET client library for the Gemini protocol
https://github.com/aschuhardt/Opal
csharp dotnet dotnet-core dotnet-standard dotnet6 dotnet7 dotnet8 gemini gemini-client gemini-protocol smolnet titan titan-protocol
Last synced: 3 months ago
JSON representation
A .NET client library for the Gemini protocol
- Host: GitHub
- URL: https://github.com/aschuhardt/Opal
- Owner: aschuhardt
- License: mit
- Created: 2022-05-04T06:58:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-06T21:19:58.000Z (10 months ago)
- Last Synced: 2024-05-20T15:43:44.246Z (6 months ago)
- Topics: csharp, dotnet, dotnet-core, dotnet-standard, dotnet6, dotnet7, dotnet8, gemini, gemini-client, gemini-protocol, smolnet, titan, titan-protocol
- Language: C#
- Homepage:
- Size: 174 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gemini - Opal - Gemini client library targeting .NET Standard 2.0. Built-in support for TOFU and client certificates. (Programming / Graphical)
README
![Opal on Nuget](https://img.shields.io/nuget/v/Opal) ![Opal build](https://img.shields.io/github/actions/workflow/status/aschuhardt/Opal/dotnet.yml?branch=main) ![Last commit](https://img.shields.io/github/last-commit/aschuhardt/Opal) ![MIT](https://img.shields.io/github/license/aschuhardt/Opal)
# Opal
A client library for the Gemini and Titan protocols targeting .NET Standard 2.0 and .NET 7## Features
- Asynchronous requests
- Typed Gemtext document handling
- Event-based user input
- Configurable redirect behavior
- Optional client certificate support with creation and persistence
- Optional TOFU semantics with persistent certificate caching
- No external dependencies## Usage
Install the Nuget package```
Install-Package Opal -Version 1.7.6
```Create an instance of a client and make requests
```csharp
// the default behavior is to automatically follow redirects and to persit
// local and remote certificates to disk
var client = new OpalClient();var response = await client.SendRequestAsync("gemini.circumlunar.space");
if (response is GemtextResponse gmi)
{
// the response body may accessed directly...
await using (var reader = new StreamReader(gmi.Body))
Console.WriteLine(reader.ReadToEnd());
// ... or as a collection of strongly-typed ILine objects
foreach (var line in gmi.AsDocument())
{
if (line is LinkLine link)
Console.WriteLine($"Found link to {link.Uri}");
Console.WriteLine(line);
}
}
```