Skip to content

Instantly share code, notes, and snippets.

View yschimke's full-sized avatar

Yuri Schimke yschimke

View GitHub Profile
commit dbadaa6b614d02b37b6c7c773a418fd0216d85d6
Author: Yuri Schimke <yuri@schimke.ee>
Date: Sat Apr 13 10:59:43 2019 +0100
HttpExchange Kotlin conversion
diff --git a/okhttp/src/main/java/okhttp3/internal/http/ExchangeCode.kt b/okhttp/src/main/java/okhttp3/internal/http/ExchangeCode.kt
index 9fa1a70d..b0c3e2e7 100644
--- a/okhttp/src/main/java/okhttp3/internal/http/ExchangeCode.kt
+++ b/okhttp/src/main/java/okhttp3/internal/http/ExchangeCode.kt
package okhttp3.tls
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.tls.HandshakeCertificates.Builder
fun main() {
val request = Request.Builder()
.url("https://httpbin.org/get")
.build()
{ "version": "1.27", "url": "https://github.com/rsocket/rsocket-cli/releases/download/1.27/rsocketcli.exe", "bin": "rsocketcli.exe" }
{ "version": "2.27", "url": "https://github.com/yschimke/okurl/releases/download/2.27/okurl.exe", "bin": "okurl.exe" }
{ "version": "0.2", "url": "https://github.com/yschimke/cooee-cli/releases/download/0.2/cooee.exe", "bin": "cooee.exe" }
{ "version": "0.2", "url": "https://github.com/yschimke/certifikit/releases/download/0.2.ys/cft.exe", "bin": "cft.exe" }
package com.example.myapplication
import android.annotation.SuppressLint
import android.os.Bundle
import android.security.KeyChain
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.snackbar.Snackbar
#!/usr/bin/env -S kotlinc-jvm -nowarn -script
@file:Repository("https://jcenter.bintray.com")
@file:Repository("https://oss.jfrog.org/oss-snapshot-local")
@file:DependsOn("io.rsocket.kotlin:rsocket-transport-ktor-client-jvm:0.13.0-SNAPSHOT")
@file:DependsOn("io.ktor:ktor-client-cio-jvm:1.5.0")
@file:CompilerOptions("-jvm-target", "1.8")
import io.ktor.client.*
import io.ktor.network.selector.*
@Configuration
@EnableRSocketSecurity
@EnableReactiveMethodSecurity
// https://spring.io/blog/2020/06/17/getting-started-with-rsocket-spring-security
class SecurityConfig {
@Bean
fun messageHandler(strategies: RSocketStrategies?): RSocketMessageHandler {
val mh = RSocketMessageHandler()
mh.argumentResolverConfigurer.addCustomResolver(AuthenticationPrincipalArgumentResolver())
mh.rSocketStrategies = strategies!!
/*
* Copyright (C) 2014 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software