Abstract
A successful story of reimplementing a safe-browsing proxy for Telefónica, moving from C++ and socket handling, to Go and packet management, and how Go can help you to be productive and efficient, and to achieve a high-quality product. In the last years, several projects in Telefónica were based on Awanode. Awanode is a C++ proxy, on top of libev, that managed socket connections in 2 different network interfaces (ingress and egress). Awanode receives HTTP(S) requests in ingress interface, apply several policies (customizable by each project), and forward the requests to the egress interface to reach any Internet service. Although projects using Awanode were successful, working with it introduces several challenges: - Development in C++ is not very productive. Developers must be very careful during the development because introducing a bug during the implementation becomes very difficult to track afterwards. Most of the times, memory leaks or invalid memory access were fixed after several days reading hundreds of lines of code. - As a result of the previous point, a custom SDL was developed to customize the platform. But it introduced other problems out of the scope. - Handling sockets, as nginx or other well-known proxies, is simple to develop. However, tuning it to reach the maximum performance is a time consuming task. A lot of issues appeared due to handling connections (IP and port spoofing, exhausting the available ports in the host, conflicting with other network infrastructure deployed in the platform, …).