The increasing demand for video content and the fast adoption of HTTP Adaptive Streaming (HAS) has led to the need for sophisticated streaming optimization solutions. One of the main drawbacks of HAS is that the user is responsible for deciding which video quality to request without taking into account the server load, the number of users, fairness and more. Therefore, traffic shaping server, which takes these factors into account is needed. In this paper we present a HAS traffic shaping algorithm that in one hand tries to maximize user experience by providing the quality which is the closest to the one that the user requested while in other hand takes into account the server constrains. Simulation results show that the proposed solution effectively serves up to a 28% more users when the network is congested, while the users experienced an average bit-rate decreased up to 12% and the average PSNR decrease was 0.26 dB.