diff --git a/AobaClient/src/main.rs b/AobaClient/src/main.rs index 8ea533c..ad305c8 100644 --- a/AobaClient/src/main.rs +++ b/AobaClient/src/main.rs @@ -15,7 +15,7 @@ pub const HOST: &'static str = "http://localhost:5164"; #[cfg(debug_assertions)] pub const RPC_HOST: &'static str = "http://localhost:5164"; #[cfg(not(debug_assertions))] -pub const RPC_HOST: &'static str = "https://grpc.aoba.app"; +pub const RPC_HOST: &'static str = "https://grpc.aoba.app:8443"; #[cfg(not(debug_assertions))] pub const HOST: &'static str = "https://aoba.app"; diff --git a/AobaCore/Extensions.cs b/AobaCore/Extensions.cs index e05b947..6ccb226 100644 --- a/AobaCore/Extensions.cs +++ b/AobaCore/Extensions.cs @@ -26,6 +26,7 @@ public static class Extensions services.AddSingleton(dbClient); services.AddSingleton(db); services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddHostedService(); return services; diff --git a/AobaCore/Services/ThumbnailService.cs b/AobaCore/Services/ThumbnailService.cs index d97ecdf..f0f2b40 100644 --- a/AobaCore/Services/ThumbnailService.cs +++ b/AobaCore/Services/ThumbnailService.cs @@ -18,7 +18,7 @@ internal class ThumbnailService(IMongoDatabase db, AobaService aobaService) public async Task GetThumbnailAsync(ObjectId id) { - + throw new NotImplementedException(); } public async Task GenerateThumbnailAsync(ObjectId id) diff --git a/AobaServer/Program.cs b/AobaServer/Program.cs index 4b40235..230d9f3 100644 --- a/AobaServer/Program.cs +++ b/AobaServer/Program.cs @@ -11,6 +11,18 @@ using Microsoft.AspNetCore.Http.Features; using Microsoft.IdentityModel.Tokens; var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.ConfigureKestrel(o => +{ + o.ListenAnyIP(8081, lo => + { + lo.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2; + }); + o.ListenAnyIP(8080, lo => + { + lo.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2; + }); +}); var config = builder.Configuration; // Add services to the container. builder.Services.AddControllers(opt => opt.ModelBinderProviders.Add(new BsonIdModelBinderProvider())); diff --git a/AobaServer/Services/AobaRpcService.cs b/AobaServer/Services/AobaRpcService.cs index 433ef54..108783e 100644 --- a/AobaServer/Services/AobaRpcService.cs +++ b/AobaServer/Services/AobaRpcService.cs @@ -9,8 +9,6 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; -using Microsoft.AspNetCore.Mvc; - using MongoDB.Bson.IO; using System.Text.Json; diff --git a/AobaServer/appsettings.json b/AobaServer/appsettings.json index 71cd09a..4d57e10 100644 --- a/AobaServer/appsettings.json +++ b/AobaServer/appsettings.json @@ -1,7 +1,7 @@ { "Kestrel": { "EndpointDefaults": { - "Protocols": "Http1AndHttp2", + "Protocols": "Http1AndHttp2" }, "Logging": { "LogLevel": {