createHttpsWebhok static method
Future<Webhook>
createHttpsWebhok(
- Telegram telegram,
- String url,
- File certificate,
- File privateKey, {
- String? ipAddress,
- int port = 80,
- int? serverPort,
- bool uploadCertificate = false,
- int maxConnections = 40,
- List<String>? allowedUpdates,
- bool? dropPendingUpdates,
- String? secretToken,
})
Implementation
static Future<Webhook> createHttpsWebhok(
Telegram telegram, String url, io.File certificate, io.File privateKey,
{String? ipAddress,
int port = 80,
int? serverPort,
bool uploadCertificate = false,
int maxConnections = 40,
List<String>? allowedUpdates,
bool? dropPendingUpdates,
String? secretToken}) async {
var server = await io.HttpServer.bindSecure(
io.InternetAddress.anyIPv4.address,
serverPort ?? port,
io.SecurityContext()
..useCertificateChainBytes(certificate.readAsBytesSync())
..usePrivateKeyBytes(privateKey.readAsBytesSync()));
return Webhook(telegram, url, server,
ipAddress: ipAddress,
certificate: certificate,
privateKey: privateKey,
port: port,
serverPort: serverPort,
uploadCertificate: uploadCertificate,
maxConnections: maxConnections,
allowedUpdates: allowedUpdates,
secretToken: secretToken);
}