This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: grpc-server | |
namespace: default | |
spec: | |
type: ClusterIP | |
clusterIP: None | |
selector: | |
application: envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: envoy-hsvc | |
namespace: default | |
spec: | |
type: ClusterIP | |
clusterIP: None | |
selector: | |
application: envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
application: envoy | |
name: envoy | |
namespace: default | |
spec: | |
replicas: 2 | |
strategy: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String[] processData(String request) { | |
String lines[] = request.split("\r\n"); | |
int cl = -1; | |
for(String line : lines) { | |
System.out.println(line); | |
if(line.contains("Content-Length")) { | |
String x = line.substring(16); | |
cl = Integer.parseInt(x); | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dataString = ""; | |
String body = ""; | |
try | |
{ | |
while(true) | |
{ | |
int bytesRead = in.read(messageByte); | |
if (bytesRead == -1) | |
break; | |
dataString += new String(messageByte, 0, bytesRead); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get output stream | |
DataOutputStream out = new DataOutputStream(socket.getOutputStream()); | |
String message = "HTTP/1.1 200 OK\r\n" + | |
"Server: noob-server\r\n" + | |
"Date: 14 March, 1977\r\n" + | |
"\r\n" + | |
"Hello world - noob server"; | |
out.write(message.getBytes()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket = server.accept(); | |
System.out.println("Client accepted"); | |
DataInputStream in = new DataInputStream(new BufferedInputStream(socket.getInputStream())); | |
byte[] messageByte = new byte[1000]; | |
String dataString = ""; | |
while(true) | |
{ | |
int bytesRead = in.read(messageByte); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServerSocket server = new ServerSocket(80); // Listen for connection on port 89 | |
System.out.println("Server started"); | |
Socket socket = server.accept(); //Wait for client | |
System.out.println("Client accepted"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = [ | |
"csdn.net", | |
"github.com", | |
"canva.com", | |
"yahoo.co.jp", | |
"naver.com", | |
"bongacams.com", | |
"bing.com", | |
"ebay.com", | |
"yy.com", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To set available for CIU user | |
RedisUtils.ciu_live_set_availability_status(true) | |
#To disable ciu user | |
# RedisUtils.ciu_live_set_availability_status(false) | |
#To set desktop support | |
RedisUtils.ciu_live_set_platform_support("desktop", true) | |
#To disable desktop support |
NewerOlder