This paper addresses the problem of distributed constrained optimization in a multi-agent system where some agents may deviate from the prescribed update rules due to failures or malicious adversarial attacks. The objective is to minimize the collective cost of the unattacked agents while respecting the constraint limitations. To tackle this, we propose a resilient distributed projected gradient descent algorithm for online optimization that achieves sublinear individual regret, defined as the difference between the online and offline solutions. Additionally, we extend the cost function from convex combinations to more general distributed optimization scenarios. The proposed algorithm demonstrates resilience under adversarial conditions, allowing it to handle an unknown number of adversarial nodes while maintaining performance. Compared to existing methods, this approach offers a robust solution to adversarial attacks in constrained distributed optimization problems.