mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-11 05:12:26 +00:00
Fix some issues
This commit is contained in:
parent
ad5fd161ec
commit
f40228bcc4
@ -75,6 +75,8 @@ func main() {
|
|||||||
rlog.Infof("Filtering for the following authorities: %v", tap.GetFilterIPs())
|
rlog.Infof("Filtering for the following authorities: %v", tap.GetFilterIPs())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
|
||||||
// harOutputChannel, outboundLinkOutputChannel := tap.StartPassiveTapper(tapOpts)
|
// harOutputChannel, outboundLinkOutputChannel := tap.StartPassiveTapper(tapOpts)
|
||||||
filteredOutputItemsChannel := make(chan *tapApi.OutputChannelItem)
|
filteredOutputItemsChannel := make(chan *tapApi.OutputChannelItem)
|
||||||
tap.StartPassiveTapper(tapOpts, filteredOutputItemsChannel, extensions)
|
tap.StartPassiveTapper(tapOpts, filteredOutputItemsChannel, extensions)
|
||||||
|
@ -41,11 +41,7 @@ func init() {
|
|||||||
|
|
||||||
func WebSocketRoutes(app *gin.Engine, eventHandlers EventHandlers) {
|
func WebSocketRoutes(app *gin.Engine, eventHandlers EventHandlers) {
|
||||||
app.GET("/ws", func(c *gin.Context) {
|
app.GET("/ws", func(c *gin.Context) {
|
||||||
queryMap := c.Request.URL.Query()
|
query := c.DefaultQuery("q", "")
|
||||||
query := ""
|
|
||||||
if val, ok := queryMap["q"]; ok {
|
|
||||||
query = val[0]
|
|
||||||
}
|
|
||||||
websocketHandlerUI(c.Writer, c.Request, eventHandlers, false, query)
|
websocketHandlerUI(c.Writer, c.Request, eventHandlers, false, query)
|
||||||
})
|
})
|
||||||
app.GET("/wsTapper", func(c *gin.Context) {
|
app.GET("/wsTapper", func(c *gin.Context) {
|
||||||
|
@ -139,6 +139,10 @@ func GetEntry(c *gin.Context) {
|
|||||||
id, _ := strconv.Atoi(c.Param("entryId"))
|
id, _ := strconv.Atoi(c.Param("entryId"))
|
||||||
fmt.Printf("GetEntry id: %v\n", id)
|
fmt.Printf("GetEntry id: %v\n", id)
|
||||||
entry := api.Single(uint(id))
|
entry := api.Single(uint(id))
|
||||||
|
var response map[string]interface{}
|
||||||
|
if entry["response"] != nil {
|
||||||
|
response = entry["response"].(map[string]interface{})
|
||||||
|
}
|
||||||
entryData := tapApi.MizuEntry{
|
entryData := tapApi.MizuEntry{
|
||||||
Protocol: tapApi.Protocol{
|
Protocol: tapApi.Protocol{
|
||||||
Name: entry["proto"].(map[string]interface{})["name"].(string),
|
Name: entry["proto"].(map[string]interface{})["name"].(string),
|
||||||
@ -152,7 +156,7 @@ func GetEntry(c *gin.Context) {
|
|||||||
Priority: uint8(entry["proto"].(map[string]interface{})["priority"].(float64)),
|
Priority: uint8(entry["proto"].(map[string]interface{})["priority"].(float64)),
|
||||||
},
|
},
|
||||||
Request: entry["request"].(map[string]interface{}),
|
Request: entry["request"].(map[string]interface{}),
|
||||||
Response: entry["response"].(map[string]interface{}),
|
Response: response,
|
||||||
EntryId: entry["entryId"].(string),
|
EntryId: entry["entryId"].(string),
|
||||||
Entry: entry["entry"].(string),
|
Entry: entry["entry"].(string),
|
||||||
Url: entry["url"].(string),
|
Url: entry["url"].(string),
|
||||||
|
@ -269,7 +269,6 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, entryId string, resolve
|
|||||||
return &api.MizuEntry{
|
return &api.MizuEntry{
|
||||||
Protocol: protocol,
|
Protocol: protocol,
|
||||||
Request: reqDetails,
|
Request: reqDetails,
|
||||||
Response: item.Pair.Response.Payload.(map[string]interface{})["details"].(map[string]interface{}),
|
|
||||||
EntryId: entryId,
|
EntryId: entryId,
|
||||||
Entry: string(entryBytes),
|
Entry: string(entryBytes),
|
||||||
Url: fmt.Sprintf("%s%s", service, summary),
|
Url: fmt.Sprintf("%s%s", service, summary),
|
||||||
|
Loading…
Reference in New Issue
Block a user