TarsCloud / Tars

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.
BSD 3-Clause "New" or "Revised" License
9.79k stars 2.08k forks source link

I don't understand the gateway document. What is the format of the content to be transmitted? Where is the basepacket? #756

Closed TARS-Question closed 3 years ago

TARS-Question commented 4 years ago

#756

TARS-Answer commented 4 years ago

this means that when you use the tup proxy, when the client requests, you need to sequence the tarsobject into binary and put it in the body for forwarding. General scenarios are not used. The core and practical function is the mode of JSON.

TARS-Answer commented 4 years ago

这个意思是说当你使用这个tup proxy的时候,在客户端请求的时候,需要自己把tarsObject序列化成二进制,放到Body中做转发。一般的场景并不会用到。核心且实用的功能,是json的模式。

TARS-Question commented 4 years ago

In what scenarios will tup proxy be used?

TARS-Question commented 4 years ago

tup proxy在什么场景下会用到?

TARS-Answer commented 4 years ago

Tup can use this mode when your IOS or Android serialization scenario uses the tar protocol. The benefits and choices depend on your business scenario and the employees' grasp of the overall project. After all, this part requires IOS & Android development engineers to be familiar with this part of the resolution protocol.

The core point is still JSON as the RPC transport protocol, or the tar stream as the RPC transport protocol. Their role in the forwarding service is equivalent, so is the scenario used.

Generally speaking, it is recommended to use JSON for gateway users. In the future, the JSON coming in from the gateway will be dyed directly on the web. You will see the call chain and parameters of the complete gateway. After using JSON, you can configure and dye some.

TARS-Answer commented 4 years ago

tup在你的ios OR android的序列化场景使用的是tars协议的时候,可以使用这种模式。收益和选择看你的业务场景和员工对整体工程的把握,毕竟这一部分需要ios&& android的开发的工程师也熟悉这一部分的解析协议。 核心点还是json作为Rpc传输协议,还是tars流作为rpc传输协议,他们的作用在转发服务中是对等的,使用的场景也是如此。 总体而言,建议走网关的用json,后续,会在web上直接对网关进来的json做染色,会看到完整网关进来的调用链和参数,用json后面好配置染色一些。

TARS-Question commented 4 years ago

How do I access the HTTP proxy in the gateway as shown in the figure above? I tried http://127.0.0.1 : gateway port / testhost is 404.

#756(2)

TARS-Question commented 4 years ago

在gateway像上图那样配置http代理, 要怎么访问?我试了下 http://127.0.0.1 :gateway端口/testhost,是404。

#756(2)