Add Protocol struct and make it effect the UI

This commit is contained in:
M. Mert Yildiran
2021-08-21 00:47:47 +03:00
parent c668680f54
commit ccb924f507
13 changed files with 155 additions and 34 deletions

View File

@@ -140,9 +140,9 @@ func loadExtensions() {
extension.Dissector = dissector
log.Printf("Extension Properties: %+v\n", extension)
extensions[i] = extension
extensionsMap[extension.Name] = extension
allOutboundPorts = mergeUnique(allOutboundPorts, extension.OutboundPorts)
allInboundPorts = mergeUnique(allInboundPorts, extension.InboundPorts)
extensionsMap[extension.Protocol.Name] = extension
allOutboundPorts = mergeUnique(allOutboundPorts, extension.Protocol.OutboundPorts)
allInboundPorts = mergeUnique(allInboundPorts, extension.Protocol.InboundPorts)
}
log.Printf("allOutboundPorts: %v\n", allOutboundPorts)
log.Printf("allInboundPorts: %v\n", allInboundPorts)

View File

@@ -111,7 +111,7 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension
for item := range outputItems {
fmt.Printf("item: %+v\n", item)
extension := extensionsMap[item.Protocol]
extension := extensionsMap[item.Protocol.Name]
fmt.Printf("extension: %+v\n", extension)
// var req *http.Request
// marshedReq, _ := json.Marshal(item.Data.Request.Orig)