Skip to content

Instantly share code, notes, and snippets.

gistlyn

Block or report user

Report or block gistlyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gistlyn
gistlyn / main.go
Created Dec 30, 2019
Go Google protoc SSL GrpcServicesClient TodoWorld Example
View main.go
package main
import (
context "context"
"fmt"
"log"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
@gistlyn
gistlyn / main.go
Last active Dec 30, 2019
Go Google protoc insecure GrpcServicesClient TodoWorld Example
View main.go
package main
import (
context "context"
"fmt"
"log"
"google.golang.org/grpc"
pb "TodoWorld/services"
@gistlyn
gistlyn / main.dart
Created Dec 30, 2019
Dart Google protoc SSL GrpcServicesClient TodoWorld Example
View main.dart
import 'dart:io';
import 'package:grpc/grpc.dart';
import 'package:TodoWorld/services.pb.dart';
import 'package:TodoWorld/services.pbgrpc.dart';
void main(List<String> args) async {
var client = GrpcServicesClient(ClientChannel('todoworld.servicestack.net', port:50051,
options:ChannelOptions(credentials: ChannelCredentials.secure(
certificates: File('grpc.crt').readAsBytesSync(),
@gistlyn
gistlyn / main.dart
Last active Dec 30, 2019
Dart Google protoc insecure GrpcServicesClient TodoWorld Example
View main.dart
import 'dart:io';
import 'package:grpc/grpc.dart';
import 'package:TodoWorld/services.pb.dart';
import 'package:TodoWorld/services.pbgrpc.dart';
void main(List<String> args) async {
var client = GrpcServicesClient(ClientChannel('todoworld.servicestack.net', port:5054,
options:ChannelOptions(credentials: ChannelCredentials.insecure())));
@gistlyn
gistlyn / Program.java
Last active Dec 30, 2019
Java Google protoc SSL gRPC Service Client TodoWorld Example
View Program.java
import io.grpc.ManagedChannel;
import io.grpc.netty.GrpcSslContexts;
import io.grpc.netty.NettyChannelBuilder;
import java.io.File;
public class Program {
public static void main(String[] args) throws javax.net.ssl.SSLException {
ManagedChannel channel = NettyChannelBuilder.forAddress(
"todoworld.servicestack.net", 50051)
.sslContext(GrpcSslContexts.forClient()
@gistlyn
gistlyn / Program.java
Last active Dec 30, 2019
Java Google protoc insecure gRPC Service Client TodoWorld Example
View Program.java
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
public class Program {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder.forAddress(
"todoworld.servicestack.net", 5054).usePlaintext().build();
GrpcServicesGrpc.GrpcServicesBlockingStub client = GrpcServicesGrpc.newBlockingStub(channel);
@gistlyn
gistlyn / main.swift
Created Dec 29, 2019
Swift Google protoc insecure GrpcServicesClient TodoWorld Example
View main.swift
import Foundation
import GRPC
import NIO
import NIOSSL
do {
let configuration = ClientConnection.Configuration(
target: .hostAndPort("todoworld.servicestack.net", 5054),
eventLoopGroup: MultiThreadedEventLoopGroup(numberOfThreads: 1)
@gistlyn
gistlyn / main.swift
Last active Dec 29, 2019
Swift Google protoc SSL GrpcServicesClient TodoWorld Example
View main.swift
import Foundation
import GRPC
import NIO
import NIOSSL
do {
let configuration = ClientConnection.Configuration(
target: .hostAndPort("todoworld.servicestack.net", 50051),
eventLoopGroup: MultiThreadedEventLoopGroup(numberOfThreads: 1),
@gistlyn
gistlyn / Program.cs
Last active Dec 29, 2019
C# Google protoc SSL ServiceStack GrpcServicesClient TodoWorld Example
View Program.cs
using System;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using ServiceStack;
namespace TodoWorld
{
class Program
{
static async Task Main(string[] args)
@gistlyn
gistlyn / Program.cs
Last active Dec 29, 2019
C# Google protoc SSL GrpcServicesClient TodoWorld Example
View Program.cs
using System;
using System.Linq;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Net.Client;
namespace TodoWorld
{
You can’t perform that action at this time.